diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/.gitattributes b/swaggerci/recoveryservicesbackup.DefaultTag/.gitattributes new file mode 100644 index 000000000000..2125666142eb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/.gitignore b/swaggerci/recoveryservicesbackup.DefaultTag/.gitignore new file mode 100644 index 000000000000..7998f37e1e47 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/.gitignore @@ -0,0 +1,5 @@ +bin +obj +.vs +tools +test/*-TestResults.xml \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/Az.RecoveryServicesBackup.csproj b/swaggerci/recoveryservicesbackup.DefaultTag/Az.RecoveryServicesBackup.csproj new file mode 100644 index 000000000000..525ace0076d4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/Az.RecoveryServicesBackup.csproj @@ -0,0 +1,44 @@ + + + + 0.1.0 + 7.1 + netstandard2.0 + Library + Az.RecoveryServicesBackup.private + false + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup + true + false + ./bin + $(OutputPath) + Az.RecoveryServicesBackup.nuspec + true + + + 1998, 1591 + true + + + + false + TRACE;DEBUG;NETSTANDARD + + + + true + true + MSSharedLibKey.snk + TRACE;RELEASE;NETSTANDARD;SIGN + + + + + + + + + $(DefaultItemExcludes);resources/** + + + \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/Az.RecoveryServicesBackup.format.ps1xml b/swaggerci/recoveryservicesbackup.DefaultTag/Az.RecoveryServicesBackup.format.ps1xml new file mode 100644 index 000000000000..df9b65dfb7c8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/Az.RecoveryServicesBackup.format.ps1xml @@ -0,0 +1,7141 @@ + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.RecoveryServicesBackupIdentity + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.RecoveryServicesBackupIdentity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AzureRegion + + + ContainerName + + + FabricName + + + Id + + + OperationId + + + ProtectedItemName + + + RecoveryPointId + + + ResourceGroupName + + + SubscriptionId + + + VaultName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AadProperties + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AadProperties + + + + + + + + + + + + + + + + + + + + + + + + Audience + + + Authority + + + ServicePrincipalClientId + + + ServicePrincipalObjectId + + + TenantId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AadPropertiesResource + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AadPropertiesResource + + + + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureFileshareProtectedItem + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureFileshareProtectedItem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupManagementType + + + BackupSetName + + + ContainerName + + + CreateMode + + + DeferredDeleteTimeInUtc + + + DeferredDeleteTimeRemaining + + + IsDeferredDeleteScheduleUpcoming + + + IsRehydrate + + + IsScheduledForDeferredDelete + + + LastRecoveryPoint + + + PolicyId + + + ResourceGuardOperationRequest + + + SourceResourceId + + + Type + + + WorkloadType + + + FriendlyName + + + HealthStatus + + + LastBackupStatus + + + LastBackupTime + + + ProtectionState + + + ProtectionStatus + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureFileshareProtectedItemExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureFileshareProtectedItemExtendedInfo + + + + + + + + + + + + + + + + + + + + + + + + OldestRecoveryPoint + + + PolicyState + + + RecoveryPointCount + + + ResourceState + + + ResourceStateSyncTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureFileShareRecoveryPoint + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureFileShareRecoveryPoint + + + + + + + + + + + + + + + + + + + + + + + + + + + ObjectType + + + CrossRegionRestoreState + + + FileShareSnapshotUri + + + RecoveryPointSizeInGb + + + RecoveryPointTime + + + RecoveryPointType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureFileShareRestoreRequest + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureFileShareRestoreRequest + + + + + + + + + + + + + + + + + + + + + + + + ObjectType + + + CopyOption + + + RecoveryType + + + RestoreRequestType + + + SourceResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSClassicComputeVmprotectedItem + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSClassicComputeVmprotectedItem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupManagementType + + + BackupSetName + + + ContainerName + + + CreateMode + + + DeferredDeleteTimeInUtc + + + DeferredDeleteTimeRemaining + + + DiskExclusionPropertyDiskLunList + + + DiskExclusionPropertyIsInclusionList + + + ExtendedInfoOldestRecoveryPoint + + + ExtendedInfoPolicyInconsistent + + + ExtendedInfoRecoveryPointCount + + + FriendlyName + + + HealthStatus + + + IsDeferredDeleteScheduleUpcoming + + + IsRehydrate + + + IsScheduledForDeferredDelete + + + LastBackupStatus + + + LastBackupTime + + + LastRecoveryPoint + + + PolicyId + + + ProtectedItemDataId + + + ProtectionState + + + ProtectionStatus + + + ResourceGuardOperationRequest + + + SourceResourceId + + + Type + + + VirtualMachineId + + + WorkloadType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSComputeVmprotectedItem + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSComputeVmprotectedItem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupManagementType + + + BackupSetName + + + ContainerName + + + CreateMode + + + DeferredDeleteTimeInUtc + + + DeferredDeleteTimeRemaining + + + DiskExclusionPropertyDiskLunList + + + DiskExclusionPropertyIsInclusionList + + + ExtendedInfoOldestRecoveryPoint + + + ExtendedInfoPolicyInconsistent + + + ExtendedInfoRecoveryPointCount + + + FriendlyName + + + HealthStatus + + + IsDeferredDeleteScheduleUpcoming + + + IsRehydrate + + + IsScheduledForDeferredDelete + + + LastBackupStatus + + + LastBackupTime + + + LastRecoveryPoint + + + PolicyId + + + ProtectedItemDataId + + + ProtectionState + + + ProtectionStatus + + + ResourceGuardOperationRequest + + + SourceResourceId + + + Type + + + VirtualMachineId + + + WorkloadType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmErrorInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmErrorInfo + + + + + + + + + + + + + + + + + + + + + ErrorCode + + + ErrorString + + + ErrorTitle + + + Recommendation + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmHealthDetails + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmHealthDetails + + + + + + + + + + + + + + + + + + + + + Code + + + Message + + + Recommendation + + + Title + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJob + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJob + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ActivityId + + + BackupManagementType + + + EndTime + + + EntityFriendlyName + + + Operation + + + StartTime + + + Status + + + Type + + + ActionsInfo + + + VirtualMachineVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfo + + + + + + + + + + + + + + + + + + DynamicErrorMessage + + + EstimatedRemainingDuration + + + ProgressPercentage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoInternalPropertyBag + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoInternalPropertyBag + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoPropertyBag + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoPropertyBag + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobTaskDetails + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobTaskDetails + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EndTime + + + InstanceId + + + ProgressPercentage + + + StartTime + + + Status + + + TaskExecutionDetail + + + TaskId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItem + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupManagementType + + + BackupSetName + + + ContainerName + + + CreateMode + + + DeferredDeleteTimeInUtc + + + DeferredDeleteTimeRemaining + + + IsDeferredDeleteScheduleUpcoming + + + IsRehydrate + + + IsScheduledForDeferredDelete + + + LastRecoveryPoint + + + PolicyId + + + ResourceGuardOperationRequest + + + SourceResourceId + + + Type + + + WorkloadType + + + FriendlyName + + + HealthStatus + + + LastBackupStatus + + + LastBackupTime + + + ProtectedItemDataId + + + ProtectionState + + + ProtectionStatus + + + VirtualMachineId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemExtendedInfo + + + + + + + + + + + + + + + + + + OldestRecoveryPoint + + + PolicyInconsistent + + + RecoveryPointCount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureSqlProtectedItem + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureSqlProtectedItem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupManagementType + + + BackupSetName + + + ContainerName + + + CreateMode + + + DeferredDeleteTimeInUtc + + + DeferredDeleteTimeRemaining + + + IsDeferredDeleteScheduleUpcoming + + + IsRehydrate + + + IsScheduledForDeferredDelete + + + LastRecoveryPoint + + + PolicyId + + + ResourceGuardOperationRequest + + + SourceResourceId + + + Type + + + WorkloadType + + + ProtectedItemDataId + + + ProtectionState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureSqlProtectedItemExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureSqlProtectedItemExtendedInfo + + + + + + + + + + + + + + + + + + OldestRecoveryPoint + + + PolicyState + + + RecoveryPointCount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageErrorInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageErrorInfo + + + + + + + + + + + + + + + + + + ErrorCode + + + ErrorString + + + Recommendation + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJob + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJob + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ActivityId + + + BackupManagementType + + + EndTime + + + EntityFriendlyName + + + Operation + + + StartTime + + + Status + + + Type + + + ActionsInfo + + + StorageAccountName + + + StorageAccountVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobExtendedInfo + + + + + + + + + + + + DynamicErrorMessage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobExtendedInfoPropertyBag + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobExtendedInfoPropertyBag + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobTaskDetails + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobTaskDetails + + + + + + + + + + + + + + + Status + + + TaskId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItem + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupManagementType + + + BackupSetName + + + ContainerName + + + CreateMode + + + DeferredDeleteTimeInUtc + + + DeferredDeleteTimeRemaining + + + IsDeferredDeleteScheduleUpcoming + + + IsRehydrate + + + IsScheduledForDeferredDelete + + + LastRecoveryPoint + + + PolicyId + + + ResourceGuardOperationRequest + + + SourceResourceId + + + Type + + + WorkloadType + + + FriendlyName + + + LastBackupStatus + + + LastBackupTime + + + ParentName + + + ParentType + + + ProtectedItemDataSourceId + + + ProtectedItemHealthStatus + + + ProtectionState + + + ProtectionStatus + + + ServerName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemExtendedInfo + + + + + + + + + + + + + + + + + + OldestRecoveryPoint + + + PolicyState + + + RecoveryPointCount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadSapAseDatabaseProtectedItem + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadSapAseDatabaseProtectedItem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupManagementType + + + BackupSetName + + + ContainerName + + + CreateMode + + + DeferredDeleteTimeInUtc + + + DeferredDeleteTimeRemaining + + + ExtendedInfoOldestRecoveryPoint + + + ExtendedInfoPolicyState + + + ExtendedInfoRecoveryPointCount + + + FriendlyName + + + IsDeferredDeleteScheduleUpcoming + + + IsRehydrate + + + IsScheduledForDeferredDelete + + + LastBackupErrorDetailCode + + + LastBackupErrorDetailMessage + + + LastBackupErrorDetailRecommendation + + + LastBackupStatus + + + LastBackupTime + + + LastRecoveryPoint + + + ParentName + + + ParentType + + + PolicyId + + + ProtectedItemDataSourceId + + + ProtectedItemHealthStatus + + + ProtectionState + + + ProtectionStatus + + + ResourceGuardOperationRequest + + + ServerName + + + SourceResourceId + + + Type + + + WorkloadType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadSapHanaDatabaseProtectedItem + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadSapHanaDatabaseProtectedItem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupManagementType + + + BackupSetName + + + ContainerName + + + CreateMode + + + DeferredDeleteTimeInUtc + + + DeferredDeleteTimeRemaining + + + ExtendedInfoOldestRecoveryPoint + + + ExtendedInfoPolicyState + + + ExtendedInfoRecoveryPointCount + + + FriendlyName + + + IsDeferredDeleteScheduleUpcoming + + + IsRehydrate + + + IsScheduledForDeferredDelete + + + LastBackupErrorDetailCode + + + LastBackupErrorDetailMessage + + + LastBackupErrorDetailRecommendation + + + LastBackupStatus + + + LastBackupTime + + + LastRecoveryPoint + + + ParentName + + + ParentType + + + PolicyId + + + ProtectedItemDataSourceId + + + ProtectedItemHealthStatus + + + ProtectionState + + + ProtectionStatus + + + ResourceGuardOperationRequest + + + ServerName + + + SourceResourceId + + + Type + + + WorkloadType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadSqlDatabaseProtectedItem + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadSqlDatabaseProtectedItem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupManagementType + + + BackupSetName + + + ContainerName + + + CreateMode + + + DeferredDeleteTimeInUtc + + + DeferredDeleteTimeRemaining + + + ExtendedInfoOldestRecoveryPoint + + + ExtendedInfoPolicyState + + + ExtendedInfoRecoveryPointCount + + + FriendlyName + + + IsDeferredDeleteScheduleUpcoming + + + IsRehydrate + + + IsScheduledForDeferredDelete + + + LastBackupErrorDetailCode + + + LastBackupErrorDetailMessage + + + LastBackupErrorDetailRecommendation + + + LastBackupStatus + + + LastBackupTime + + + LastRecoveryPoint + + + ParentName + + + ParentType + + + PolicyId + + + ProtectedItemDataSourceId + + + ProtectedItemHealthStatus + + + ProtectionState + + + ProtectionStatus + + + ResourceGuardOperationRequest + + + ServerName + + + SourceResourceId + + + Type + + + WorkloadType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadErrorInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadErrorInfo + + + + + + + + + + + + + + + + + + + + + + + + AdditionalDetail + + + ErrorCode + + + ErrorString + + + ErrorTitle + + + Recommendation + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJob + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJob + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ActivityId + + + BackupManagementType + + + EndTime + + + EntityFriendlyName + + + Operation + + + StartTime + + + Status + + + Type + + + ActionsInfo + + + WorkloadType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobExtendedInfo + + + + + + + + + + + + DynamicErrorMessage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobExtendedInfoPropertyBag + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobExtendedInfoPropertyBag + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobTaskDetails + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobTaskDetails + + + + + + + + + + + + + + + Status + + + TaskId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadPointInTimeRecoveryPoint + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadPointInTimeRecoveryPoint + + + + + + + + + + + + + + + + + + + + + + + + + + + ObjectType + + + RecoveryPointPropertyExpiryTime + + + RecoveryPointPropertyIsSoftDeleted + + + RecoveryPointPropertyRuleName + + + RecoveryPointTimeInUtc + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadPointInTimeRestoreRequest + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadPointInTimeRestoreRequest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ObjectType + + + RecoveryMode + + + RecoveryType + + + SourceResourceId + + + TargetInfoContainerId + + + TargetInfoDatabaseName + + + TargetInfoOverwriteOption + + + TargetInfoTargetDirectoryForFileRestore + + + TargetVirtualMachineId + + + PointInTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPoint + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPoint + + + + + + + + + + + + + + + + + + ObjectType + + + RecoveryPointTimeInUtc + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequest + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequest + + + + + + + + + + + + + + + + + + + + + + + + ObjectType + + + RecoveryMode + + + RecoveryType + + + SourceResourceId + + + TargetVirtualMachineId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequestPropertyBag + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequestPropertyBag + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSapHanaPointInTimeRecoveryPoint + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSapHanaPointInTimeRecoveryPoint + + + + + + + + + + + + + + + + + + + + + + + + + + + ObjectType + + + RecoveryPointPropertyExpiryTime + + + RecoveryPointPropertyIsSoftDeleted + + + RecoveryPointPropertyRuleName + + + RecoveryPointTimeInUtc + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSapHanaPointInTimeRestoreRequest + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSapHanaPointInTimeRestoreRequest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ObjectType + + + RecoveryMode + + + RecoveryType + + + SourceResourceId + + + TargetInfoContainerId + + + TargetInfoDatabaseName + + + TargetInfoOverwriteOption + + + TargetInfoTargetDirectoryForFileRestore + + + TargetVirtualMachineId + + + PointInTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSapHanaRecoveryPoint + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSapHanaRecoveryPoint + + + + + + + + + + + + + + + + + + + + + + + + + + + ObjectType + + + RecoveryPointPropertyExpiryTime + + + RecoveryPointPropertyIsSoftDeleted + + + RecoveryPointPropertyRuleName + + + RecoveryPointTimeInUtc + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSapHanaRestoreRequest + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSapHanaRestoreRequest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ObjectType + + + RecoveryMode + + + RecoveryType + + + SourceResourceId + + + TargetInfoContainerId + + + TargetInfoDatabaseName + + + TargetInfoOverwriteOption + + + TargetInfoTargetDirectoryForFileRestore + + + TargetVirtualMachineId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlPointInTimeRecoveryPoint + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlPointInTimeRecoveryPoint + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ExtendedInfoDataDirectoryTimeInUtc + + + ObjectType + + + RecoveryPointPropertyExpiryTime + + + RecoveryPointPropertyIsSoftDeleted + + + RecoveryPointPropertyRuleName + + + RecoveryPointTimeInUtc + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlPointInTimeRestoreRequest + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlPointInTimeRestoreRequest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IsNonRecoverable + + + ObjectType + + + RecoveryMode + + + RecoveryType + + + ShouldUseAlternateTargetLocation + + + SourceResourceId + + + TargetInfoContainerId + + + TargetInfoDatabaseName + + + TargetInfoOverwriteOption + + + TargetInfoTargetDirectoryForFileRestore + + + TargetVirtualMachineId + + + PointInTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlRecoveryPoint + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlRecoveryPoint + + + + + + + + + + + + + + + + + + + + + + + + + + + ObjectType + + + RecoveryPointPropertyExpiryTime + + + RecoveryPointPropertyIsSoftDeleted + + + RecoveryPointPropertyRuleName + + + RecoveryPointTimeInUtc + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlRecoveryPointExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlRecoveryPointExtendedInfo + + + + + + + + + + + + DataDirectoryTimeInUtc + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlRestoreRequest + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlRestoreRequest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ObjectType + + + RecoveryMode + + + RecoveryType + + + SourceResourceId + + + TargetInfoContainerId + + + TargetInfoDatabaseName + + + TargetInfoOverwriteOption + + + TargetInfoTargetDirectoryForFileRestore + + + TargetVirtualMachineId + + + IsNonRecoverable + + + ShouldUseAlternateTargetLocation + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BackupManagementUsage + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BackupManagementUsage + + + + + + + + + + + + + + + + + + + + + + + + CurrentValue + + + Limit + + + NextResetTime + + + QuotaPeriod + + + Unit + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BackupResourceConfig + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BackupResourceConfig + + + + + + + + + + + + + + + + + + + + + CrossRegionRestoreFlag + + + StorageModelType + + + StorageType + + + StorageTypeState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BackupResourceConfigResource + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BackupResourceConfigResource + + + + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BekDetails + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BekDetails + + + + + + + + + + + + + + + + + + SecretData + + + SecretUrl + + + SecretVaultId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BmsaadPropertiesQueryObject + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BmsaadPropertiesQueryObject + + + + + + + + + + + + BackupManagementType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BmsBackupSummariesQueryObject + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BmsBackupSummariesQueryObject + + + + + + + + + + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BmsrpQueryObject + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BmsrpQueryObject + + + + + + + + + + + + + + + + + + + + + + + + + + + EndDate + + + ExtendedInfo + + + IncludeSoftDeletedRp + + + MoveReadyRpOnly + + + RestorePointQueryType + + + StartDate + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ClientScriptForConnect + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ClientScriptForConnect + + + + + + + + + + + + + + + + + + + + + + + + OSType + + + ScriptContent + + + ScriptExtension + + + ScriptNameSuffix + + + Url + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrossRegionRestoreRequestResource + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrossRegionRestoreRequestResource + + + + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessToken + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessToken + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccessTokenString + + + BackupManagementType + + + BmsActiveRegion + + + ContainerName + + + ContainerType + + + CoordinatorServiceStampId + + + CoordinatorServiceStampUri + + + DatasourceContainerName + + + DatasourceId + + + DatasourceName + + + DatasourceType + + + ObjectType + + + ProtectionContainerId + + + ProtectionServiceStampId + + + ProtectionServiceStampUri + + + RecoveryPointId + + + RecoveryPointTime + + + ResourceGroupName + + + ResourceId + + + ResourceName + + + RpIsManagedVirtualMachine + + + RpOriginalSaOption + + + RpVMSizeDescription + + + SubscriptionId + + + TokenExtendedInformation + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenResource + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenResource + + + + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenRpTierInformation + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenRpTierInformation + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrJobRequest + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrJobRequest + + + + + + + + + + + + + + + JobName + + + ResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrJobRequestResource + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrJobRequestResource + + + + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskExclusionProperties + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskExclusionProperties + + + + + + + + + + + + + + + DiskLunList + + + IsInclusionList + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskInformation + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskInformation + + + + + + + + + + + + + + + Lun + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmErrorInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmErrorInfo + + + + + + + + + + + + + + + ErrorString + + + Recommendation + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJob + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJob + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ActivityId + + + BackupManagementType + + + EndTime + + + EntityFriendlyName + + + Operation + + + StartTime + + + Status + + + Type + + + ActionsInfo + + + ContainerName + + + ContainerType + + + DpmServerName + + + WorkloadType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobExtendedInfo + + + + + + + + + + + + DynamicErrorMessage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobExtendedInfoPropertyBag + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobExtendedInfoPropertyBag + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobTaskDetails + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobTaskDetails + + + + + + + + + + + + + + + + + + + + + EndTime + + + StartTime + + + Status + + + TaskId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmProtectedItem + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmProtectedItem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupManagementType + + + BackupSetName + + + ContainerName + + + CreateMode + + + DeferredDeleteTimeInUtc + + + DeferredDeleteTimeRemaining + + + IsDeferredDeleteScheduleUpcoming + + + IsRehydrate + + + IsScheduledForDeferredDelete + + + LastRecoveryPoint + + + PolicyId + + + ResourceGuardOperationRequest + + + SourceResourceId + + + Type + + + WorkloadType + + + BackupEngineName + + + FriendlyName + + + ProtectionState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmProtectedItemExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmProtectedItemExtendedInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DiskStorageUsedInByte + + + IsCollocated + + + IsPresentOnCloud + + + LastBackupStatus + + + LastRefreshedAt + + + OldestRecoveryPoint + + + OnPremiseLatestRecoveryPoint + + + OnPremiseOldestRecoveryPoint + + + OnPremiseRecoveryPointCount + + + Protected + + + ProtectionGroupName + + + RecoveryPointCount + + + TotalDiskStorageSizeInByte + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmProtectedItemExtendedInfoProtectableObjectLoadPath + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmProtectedItemExtendedInfoProtectableObjectLoadPath + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.EncryptionDetails + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.EncryptionDetails + + + + + + + + + + + + + + + + + + + + + + + + EncryptionEnabled + + + KekUrl + + + KekVaultId + + + SecretKeyUrl + + + SecretKeyVaultId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ErrorDetail + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ErrorDetail + + + + + + + + + + + + + + + + + + Code + + + Message + + + Recommendation + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.GenericProtectedItem + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.GenericProtectedItem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupManagementType + + + BackupSetName + + + ContainerName + + + CreateMode + + + DeferredDeleteTimeInUtc + + + DeferredDeleteTimeRemaining + + + IsDeferredDeleteScheduleUpcoming + + + IsRehydrate + + + IsScheduledForDeferredDelete + + + LastRecoveryPoint + + + PolicyId + + + ResourceGuardOperationRequest + + + SourceResourceId + + + Type + + + WorkloadType + + + FabricName + + + FriendlyName + + + PolicyState + + + ProtectedItemId + + + ProtectionState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.GenericProtectedItemSourceAssociations + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.GenericProtectedItemSourceAssociations + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.GenericRecoveryPoint + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.GenericRecoveryPoint + + + + + + + + + + + + + + + + + + + + + + + + ObjectType + + + FriendlyName + + + RecoveryPointAdditionalInfo + + + RecoveryPointTime + + + RecoveryPointType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IaasVMRecoveryPoint + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IaasVMRecoveryPoint + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ObjectType + + + IsInstantIlrSessionActive + + + IsManagedVirtualMachine + + + IsSourceVMEncrypted + + + OSType + + + OriginalStorageAccountOption + + + RecoveryPointAdditionalInfo + + + RecoveryPointTime + + + RecoveryPointType + + + SourceVMStorageType + + + VirtualMachineSize + + + Zone + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IaasVMRestoreRequest + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IaasVMRestoreRequest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ObjectType + + + AffinityGroup + + + CreateNewCloudService + + + DiskEncryptionSetId + + + OriginalStorageAccountOption + + + RecoveryPointId + + + RecoveryType + + + Region + + + RestoreDiskLunList + + + RestoreWithManagedDisk + + + SourceResourceId + + + StorageAccountId + + + SubnetId + + + TargetDomainNameId + + + TargetResourceGroupId + + + TargetVirtualMachineId + + + VirtualNetworkId + + + Zone + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IdentityBasedRestoreDetails + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IdentityBasedRestoreDetails + + + + + + + + + + + + + + + ObjectType + + + TargetStorageAccountId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IdentityInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IdentityInfo + + + + + + + + + + + + + + + IsSystemAssignedIdentity + + + ManagedIdentityResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.Job + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.Job + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ActivityId + + + BackupManagementType + + + EndTime + + + EntityFriendlyName + + + Operation + + + StartTime + + + Status + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.JobQueryObject + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.JobQueryObject + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupManagementType + + + EndTime + + + JobId + + + Operation + + + StartTime + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.JobResource + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.JobResource + + + + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.JobResourceList + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.JobResourceList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.KekDetails + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.KekDetails + + + + + + + + + + + + + + + + + + KeyBackupData + + + KeyUrl + + + KeyVaultId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.KeyAndSecretDetails + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.KeyAndSecretDetails + + + + + + + + + + + + EncryptionMechanism + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.KpiResourceHealthDetails + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.KpiResourceHealthDetails + + + + + + + + + + + + ResourceHealthStatus + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabErrorInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabErrorInfo + + + + + + + + + + + + + + + ErrorString + + + Recommendation + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabFileFolderProtectedItem + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabFileFolderProtectedItem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupManagementType + + + BackupSetName + + + ContainerName + + + CreateMode + + + DeferredDeleteTimeInUtc + + + DeferredDeleteTimeRemaining + + + IsDeferredDeleteScheduleUpcoming + + + IsRehydrate + + + IsScheduledForDeferredDelete + + + LastRecoveryPoint + + + PolicyId + + + ResourceGuardOperationRequest + + + SourceResourceId + + + Type + + + WorkloadType + + + ComputerName + + + DeferredDeleteSyncTimeInUtc + + + FriendlyName + + + LastBackupStatus + + + LastBackupTime + + + ProtectionState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabFileFolderProtectedItemExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabFileFolderProtectedItemExtendedInfo + + + + + + + + + + + + + + + + + + LastRefreshedAt + + + OldestRecoveryPoint + + + RecoveryPointCount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJob + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJob + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ActivityId + + + BackupManagementType + + + EndTime + + + EntityFriendlyName + + + Operation + + + StartTime + + + Status + + + Type + + + ActionsInfo + + + MabServerName + + + MabServerType + + + WorkloadType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobExtendedInfo + + + + + + + + + + + + DynamicErrorMessage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobExtendedInfoPropertyBag + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobExtendedInfoPropertyBag + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobTaskDetails + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobTaskDetails + + + + + + + + + + + + + + + + + + + + + EndTime + + + StartTime + + + Status + + + TaskId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.NameInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.NameInfo + + + + + + + + + + + + + + + LocalizedValue + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.NewErrorResponseError + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.NewErrorResponseError + + + + + + + + + + + + + + + + + + Code + + + Message + + + Target + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatus + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatus + + + + + + + + + + + + + + + + + + + + + + + + EndTime + + + Id + + + Name + + + StartTime + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusError + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusError + + + + + + + + + + + + + + + Code + + + Message + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusExtendedInfo + + + + + + + + + + + + ObjectType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusJobExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusJobExtendedInfo + + + + + + + + + + + + + + + ObjectType + + + JobId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusJobsExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusJobsExtendedInfo + + + + + + + + + + + + + + + ObjectType + + + JobId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusJobsExtendedInfoFailedJobsError + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusJobsExtendedInfoFailedJobsError + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusProvisionIlrExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusProvisionIlrExtendedInfo + + + + + + + + + + + + ObjectType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusRecoveryPointExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusRecoveryPointExtendedInfo + + + + + + + + + + + + + + + ObjectType + + + DeletedBackupItemVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.PointInTimeRange + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.PointInTimeRange + + + + + + + + + + + + + + + EndTime + + + StartTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ProtectedItem + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ProtectedItem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupManagementType + + + BackupSetName + + + ContainerName + + + CreateMode + + + DeferredDeleteTimeInUtc + + + DeferredDeleteTimeRemaining + + + IsDeferredDeleteScheduleUpcoming + + + IsRehydrate + + + IsScheduledForDeferredDelete + + + LastRecoveryPoint + + + PolicyId + + + ResourceGuardOperationRequest + + + SourceResourceId + + + Type + + + WorkloadType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ProtectedItemQueryObject + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ProtectedItemQueryObject + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupEngineName + + + BackupManagementType + + + BackupSetName + + + ContainerName + + + FabricName + + + FriendlyName + + + HealthState + + + ItemType + + + PolicyName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ProtectedItemResource + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ProtectedItemResource + + + + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ProtectedItemResourceList + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ProtectedItemResourceList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPoint + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPoint + + + + + + + + + + + + ObjectType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointDiskConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointDiskConfiguration + + + + + + + + + + + + + + + NumberOfDisksAttachedToVM + + + NumberOfDisksIncludedInBackup + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointMoveReadinessInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointMoveReadinessInfo + + + + + + + + + + + + + + + AdditionalInfo + + + IsReadyForMove + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointProperties + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointProperties + + + + + + + + + + + + + + + + + + ExpiryTime + + + IsSoftDeleted + + + RuleName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointResource + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointResource + + + + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointResourceList + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointResourceList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformation + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformation + + + + + + + + + + + + + + + Status + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationExtendedInfo + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.Resource + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.Resource + + + + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceHealthDetails + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceHealthDetails + + + + + + + + + + + + + + + + + + + + + Code + + + Message + + + Recommendation + + + Title + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceList + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTags + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RestoreFileSpecs + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RestoreFileSpecs + + + + + + + + + + + + + + + + + + FileSpecType + + + Path + + + TargetFolderPath + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RestoreRequest + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RestoreRequest + + + + + + + + + + + + ObjectType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectory + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectory + + + + + + + + + + + + + + + + + + LogicalName + + + Path + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectoryMapping + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectoryMapping + + + + + + + + + + + + + + + + + + + + + MappingType + + + SourceLogicalName + + + SourcePath + + + TargetPath + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetAfsRestoreInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetAfsRestoreInfo + + + + + + + + + + + + + + + Name + + + TargetResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetRestoreInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetRestoreInfo + + + + + + + + + + + + + + + + + + + + + ContainerId + + + DatabaseName + + + OverwriteOption + + + TargetDirectoryForFileRestore + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.WorkloadCrrAccessToken + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.WorkloadCrrAccessToken + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccessTokenString + + + BackupManagementType + + + BmsActiveRegion + + + ContainerName + + + ContainerType + + + CoordinatorServiceStampId + + + CoordinatorServiceStampUri + + + DatasourceContainerName + + + DatasourceId + + + DatasourceName + + + DatasourceType + + + ObjectType + + + ProtectionContainerId + + + ProtectionServiceStampId + + + ProtectionServiceStampUri + + + RecoveryPointId + + + RecoveryPointTime + + + ResourceGroupName + + + ResourceId + + + ResourceName + + + RpIsManagedVirtualMachine + + + RpOriginalSaOption + + + RpVMSizeDescription + + + SubscriptionId + + + TokenExtendedInformation + + + ContainerId + + + PolicyId + + + PolicyName + + + ProtectableObjectContainerHostOSName + + + ProtectableObjectFriendlyName + + + ProtectableObjectParentLogicalContainerName + + + ProtectableObjectProtectionState + + + ProtectableObjectUniqueName + + + ProtectableObjectWorkloadType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.ErrorAdditionalInfo + + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.ErrorAdditionalInfo + + + + + + + + + + + + Type + + + + + + + + \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/Az.RecoveryServicesBackup.nuspec b/swaggerci/recoveryservicesbackup.DefaultTag/Az.RecoveryServicesBackup.nuspec new file mode 100644 index 000000000000..3d8d29dbe21d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/Az.RecoveryServicesBackup.nuspec @@ -0,0 +1,32 @@ + + + + Az.RecoveryServicesBackup + 0.1.0 + Microsoft Corporation + Microsoft Corporation + true + https://aka.ms/azps-license + https://github.com/Azure/azure-powershell + Microsoft Azure PowerShell: $(service-name) cmdlets + + Microsoft Corporation. All rights reserved. + Azure ResourceManager ARM PSModule $(service-name) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/Az.RecoveryServicesBackup.psd1 b/swaggerci/recoveryservicesbackup.DefaultTag/Az.RecoveryServicesBackup.psd1 new file mode 100644 index 000000000000..650948637d05 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/Az.RecoveryServicesBackup.psd1 @@ -0,0 +1,24 @@ +@{ + GUID = '7133beef-6202-48f3-b2bb-3ec93f66e5c1' + RootModule = './Az.RecoveryServicesBackup.psm1' + ModuleVersion = '0.1.0' + CompatiblePSEditions = 'Core', 'Desktop' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = 'Microsoft Corporation. All rights reserved.' + Description = 'Microsoft Azure PowerShell: RecoveryServicesBackup cmdlets' + PowerShellVersion = '5.1' + DotNetFrameworkVersion = '4.7.2' + RequiredAssemblies = './bin/Az.RecoveryServicesBackup.private.dll' + FormatsToProcess = './Az.RecoveryServicesBackup.format.ps1xml' + FunctionsToExport = 'Get-AzRecoveryServicesBackupAadProperty', 'Get-AzRecoveryServicesBackupCrrJob', 'Get-AzRecoveryServicesBackupCrrJobDetail', 'Get-AzRecoveryServicesBackupCrrOperationResult', 'Get-AzRecoveryServicesBackupCrrOperationStatus', 'Get-AzRecoveryServicesBackupProtectedItemsCrr', 'Get-AzRecoveryServicesBackupRecoveryPointAccessToken', 'Get-AzRecoveryServicesBackupRecoveryPointsCrr', 'Get-AzRecoveryServicesBackupResourceStorageConfig', 'Get-AzRecoveryServicesBackupUsageSummariesCrr', 'Start-AzRecoveryServicesBackupCrossRegionRestore', 'Update-AzRecoveryServicesBackupResourceStorageConfig', '*' + AliasesToExport = '*' + PrivateData = @{ + PSData = @{ + Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'RecoveryServicesBackup' + LicenseUri = 'https://aka.ms/azps-license' + ProjectUri = 'https://github.com/Azure/azure-powershell' + ReleaseNotes = '' + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/Az.RecoveryServicesBackup.psm1 b/swaggerci/recoveryservicesbackup.DefaultTag/Az.RecoveryServicesBackup.psm1 new file mode 100644 index 000000000000..d9b789737fc0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/Az.RecoveryServicesBackup.psm1 @@ -0,0 +1,111 @@ +# region Generated + # ---------------------------------------------------------------------------------- + # Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. + # ---------------------------------------------------------------------------------- + # Load required Az.Accounts module + $accountsName = 'Az.Accounts' + $accountsModule = Get-Module -Name $accountsName + if(-not $accountsModule) { + $localAccountsPath = Join-Path $PSScriptRoot 'generated/modules' + if(Test-Path -Path $localAccountsPath) { + $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1 + if($localAccounts) { + $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru + } + } + if(-not $accountsModule) { + $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0 + if($hasAdequateVersion) { + $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru + } + } + } + + if(-not $accountsModule) { + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://learn.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop + } elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) { + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop + } + Write-Information "Loaded Module '$($accountsModule.Name)'" + + # Load the private module dll + $null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.RecoveryServicesBackup.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module]::Instance + + # Ask for the shared functionality table + $VTable = Register-AzModule + + # Tweaks the pipeline on module load + $instance.OnModuleLoad = $VTable.OnModuleLoad + + # Following two delegates are added for telemetry + $instance.GetTelemetryId = $VTable.GetTelemetryId + $instance.Telemetry = $VTable.Telemetry + + # Delegate to sanitize the output object + $instance.SanitizeOutput = $VTable.SanitizerHandler + + # Delegate to get the telemetry info + $instance.GetTelemetryInfo = $VTable.GetTelemetryInfo + + # Tweaks the pipeline per call + $instance.OnNewRequest = $VTable.OnNewRequest + + # Gets shared parameter values + $instance.GetParameterValue = $VTable.GetParameterValue + + # Allows shared module to listen to events from this module + $instance.EventListener = $VTable.EventListener + + # Gets shared argument completers + $instance.ArgumentCompleter = $VTable.ArgumentCompleter + + # The name of the currently selected Azure profile + $instance.ProfileName = $VTable.ProfileName + + # Load the custom module + $customModulePath = Join-Path $PSScriptRoot './custom/Az.RecoveryServicesBackup.custom.psm1' + if(Test-Path $customModulePath) { + $null = Import-Module -Name $customModulePath + } + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export proxy cmdlet scripts + $exportsPath = Join-Path $PSScriptRoot './exports' + $directories = Get-ChildItem -Directory -Path $exportsPath + $profileDirectory = $null + if($instance.ProfileName) { + if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) { + $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName } + } else { + # Don't export anything if the profile doesn't exist for the module + $exportsPath = $null + Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded." + } + } elseif(($directories | Measure-Object).Count -gt 0) { + # Load the last folder if no profile is selected + $profileDirectory = $directories | Select-Object -Last 1 + } + + if($profileDirectory) { + Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" + $exportsPath = $profileDirectory.FullName + } + + if($exportsPath) { + Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath + Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias) + } + + # Finalize initialization of this module + $instance.Init(); + Write-Information "Loaded Module '$($instance.Name)'" +# endregion diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/MSSharedLibKey.snk b/swaggerci/recoveryservicesbackup.DefaultTag/MSSharedLibKey.snk new file mode 100644 index 000000000000..695f1b38774e Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/MSSharedLibKey.snk differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/README.md b/swaggerci/recoveryservicesbackup.DefaultTag/README.md new file mode 100644 index 000000000000..a6461b74433f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/README.md @@ -0,0 +1,24 @@ + +# Az.RecoveryServicesBackup +This directory contains the PowerShell module for the RecoveryServicesBackup service. + +--- +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.RecoveryServicesBackup`, see [how-to.md](how-to.md). + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/build-module.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/build-module.ps1 new file mode 100644 index 000000000000..db63d5ffdfbe --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/build-module.ps1 @@ -0,0 +1,175 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [Switch]$DisableAfterBuildTasks) +$ErrorActionPreference = 'Stop' + +if($PSEdition -ne 'Core') { + Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.' +} + +if(-not $Isolated -and -not $Debugger) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + + if($LastExitCode -ne 0) { + # Build failed. Don't attempt to run the module. + return + } + + if($Test) { + . (Join-Path $PSScriptRoot 'test-module.ps1') + if($LastExitCode -ne 0) { + # Tests failed. Don't attempt to run the module. + return + } + } + + if($Docs) { + . (Join-Path $PSScriptRoot 'generate-help.ps1') + if($LastExitCode -ne 0) { + # Docs generation failed. Don't attempt to run the module. + return + } + } + + if($Pack) { + . (Join-Path $PSScriptRoot 'pack-module.ps1') + if($LastExitCode -ne 0) { + # Packing failed. Don't attempt to run the module. + return + } + } + + $runModulePath = Join-Path $PSScriptRoot 'run-module.ps1' + if($Code) { + . $runModulePath -Code + } elseif($Run) { + . $runModulePath + } else { + Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script." + } + return +} + +$binFolder = Join-Path $PSScriptRoot 'bin' +$objFolder = Join-Path $PSScriptRoot 'obj' + +$isAzure = [System.Convert]::ToBoolean('true') + +if(-not $Debugger) { + Write-Host -ForegroundColor Green 'Cleaning build folders...' + $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder + + if((Test-Path $binFolder) -or (Test-Path $objFolder)) { + Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?' + Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.' + } + + Write-Host -ForegroundColor Green 'Compiling module...' + $buildConfig = 'Debug' + if($Release) { + $buildConfig = 'Release' + } + dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo + if($LastExitCode -ne 0) { + Write-Error 'Compilation failed.' + } + + $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release') +} + +$dll = Join-Path $PSScriptRoot 'bin/Az.RecoveryServicesBackup.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} + +# Load DLL to use build-time cmdlets +$null = Import-Module -Name $dll + +$modulePaths = $dll +$customPsm1 = Join-Path $PSScriptRoot 'custom/Az.RecoveryServicesBackup.custom.psm1' +if(Test-Path $customPsm1) { + $modulePaths = @($dll, $customPsm1) +} + +$exportsFolder = Join-Path $PSScriptRoot 'exports' +if(Test-Path $exportsFolder) { + $null = Get-ChildItem -Path $exportsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $exportsFolder + +$internalFolder = Join-Path $PSScriptRoot 'internal' +if(Test-Path $internalFolder) { + $null = Get-ChildItem -Path $internalFolder -Recurse -Exclude '*.psm1', 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $internalFolder + +$psd1 = Join-Path $PSScriptRoot './Az.RecoveryServicesBackup.psd1' +$guid = Get-ModuleGuid -Psd1Path $psd1 +$moduleName = 'Az.RecoveryServicesBackup' +$examplesFolder = Join-Path $PSScriptRoot 'examples' +$null = New-Item -ItemType Directory -Force -Path $examplesFolder + +Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...' +$modelCmdlets = @() +$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets' +if (Test-Path $modelCmdletFolder) { + $null = Remove-Item -Force -Recurse -Path $modelCmdletFolder +} +if ($modelCmdlets.Count -gt 0) { + . (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1') + CreateModelCmdlet($modelCmdlets) +} + +if($NoDocs) { + Write-Host -ForegroundColor Green 'Creating exports...' + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder +} else { + Write-Host -ForegroundColor Green 'Creating exports and docs...' + $moduleDescription = 'Microsoft Azure PowerShell: RecoveryServicesBackup cmdlets' + $docsFolder = Join-Path $PSScriptRoot 'docs' + if(Test-Path $docsFolder) { + $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue + } + $null = New-Item -ItemType Directory -Force -Path $docsFolder + $addComplexInterfaceInfo = !$isAzure + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo +} + +Write-Host -ForegroundColor Green 'Creating format.ps1xml...' +$formatPs1xml = Join-Path $PSScriptRoot './Az.RecoveryServicesBackup.format.ps1xml' +Export-FormatPs1xml -FilePath $formatPs1xml + +Write-Host -ForegroundColor Green 'Creating psd1...' +$customFolder = Join-Path $PSScriptRoot 'custom' +Export-Psd1 -ExportsFolder $exportsFolder -CustomFolder $customFolder -Psd1Path $psd1 -ModuleGuid $guid + +Write-Host -ForegroundColor Green 'Creating test stubs...' +$testFolder = Join-Path $PSScriptRoot 'test' +$null = New-Item -ItemType Directory -Force -Path $testFolder +Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFolder $testFolder + +Write-Host -ForegroundColor Green 'Creating example stubs...' +Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder + +if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')) +{ + Write-Host -ForegroundColor Green 'Creating ux metadata...' + . (Join-Path $PSScriptRoot 'generate-portal-ux.ps1') +} + +if (-not $DisableAfterBuildTasks){ + $afterBuildTasksPath = Join-Path $PSScriptRoot '' + $afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable + if(Test-Path -Path $afterBuildTasksPath -PathType leaf){ + Write-Host -ForegroundColor Green 'Running after build tasks...' + . $afterBuildTasksPath @afterBuildTasksArgs + } +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/check-dependencies.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/check-dependencies.ps1 new file mode 100644 index 000000000000..ec3055201a71 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/check-dependencies.ps1 @@ -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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) { + if($predicate) { + $module = Get-Module -ListAvailable -Name $moduleName + if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0) -or ($requiredVersion -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -eq [System.Version]$requiredVersion } | Measure-Object).Count -eq 0)) { + $null = New-Item -ItemType Directory -Force -Path $path + Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..." + if ($requiredVersion) { + Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path + }elseif($versionMinimum) { + Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path + } else { + Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path + } + } + } +} + +$ProgressPreference = 'SilentlyContinue' +$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1 + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) { + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5' +DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1' + +$tools = Join-Path $PSScriptRoot 'tools' +$resourceDir = Join-Path $tools 'Resources' +$resourceModule = Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psm1' + +if ($Resources.IsPresent -and ((-not (Test-Path -Path $resourceModule)) -or $RegenerateSupportModule.IsPresent)) { + Write-Host -ForegroundColor Green "Building local Resource module used for test..." + Set-Location $resourceDir + $null = autorest .\README.md --use:@autorest/powershell@3.0.414 --output-folder=$HOME/.PSSharedModules/Resources + $null = Copy-Item custom/* $HOME/.PSSharedModules/Resources/custom/ + Set-Location $HOME/.PSSharedModules/Resources + $null = .\build-module.ps1 + Set-Location $PSScriptRoot +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/create-model-cmdlets.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/create-model-cmdlets.ps1 new file mode 100644 index 000000000000..36c579247bdb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/create-model-cmdlets.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +function CreateModelCmdlet { + + param([string[]]$Models) + + if ($Models.Count -eq 0) + { + return + } + + $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated/api') 'Models' + $OutputDir = Join-Path $PSScriptRoot 'custom/autogen-model-cmdlets' + $null = New-Item -ItemType Directory -Force -Path $OutputDir + if (''.length -gt 0) { + $ModuleName = '' + } else { + $ModuleName = 'Az.RecoveryServicesBackup' + } + + $CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs + $Content = '' + $null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 ) + { $Content += get-content $_.fullname -raw + } } + + $Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content) + $Nodes = $Tree.ChildNodes().ChildNodes() + foreach ($Model in $Models) + { + $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$Model") } + if ($InterfaceNode.count -eq 0) { + continue + } + # through a queue, we iterate all the parent models. + $Queue = @($InterfaceNode) + $visited = @("I$Model") + $AllInterfaceNodes = @() + while ($Queue.count -ne 0) + { + $AllInterfaceNodes += $Queue[0] + # Baselist contains the direct parent models. + foreach ($parent in $Queue[0].BaseList.Types) + { + if (($parent.Type.Right.Identifier.Value -ne 'IJsonSerializable') -and (-not $visited.Contains($parent.Type.Right.Identifier.Value))) + { + $Queue = [Array]$Queue + ($Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq $parent.Type.Right.Identifier.Value) }) + $visited = [Array]$visited + $parent.Type.Right.Identifier.Value + } + } + $first, $Queue = $Queue + } + + $Namespace = $InterfaceNode.Parent.Name + $ObjectType = $Model + $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}" + # remove duplicated module name + if ($ObjectType.StartsWith('RecoveryServicesBackup')) { + $ModulePrefix = '' + } else { + $ModulePrefix = 'RecoveryServicesBackup' + } + $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir + + $ParameterDefineScriptList = New-Object System.Collections.Generic.List[string] + $ParameterAssignScriptList = New-Object System.Collections.Generic.List[string] + foreach ($Node in $AllInterfaceNodes) + { + foreach ($Member in $Node.Members) + { + $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments + $Required = $false + $Description = "" + $Readonly = $False + foreach ($Argument in $Arguments) + { + if ($Argument.NameEquals.Name.Identifier.Value -eq "Required") + { + $Required = $Argument.Expression.Token.Value + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Description") + { + $Description = $Argument.Expression.Token.Value.Trim('.').replace('"', '`"') + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Readonly") + { + $Readonly = $Argument.Expression.Token.Value + } + } + if ($Readonly) + { + continue + } + $Identifier = $Member.Identifier.Value + $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1] + $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string] + if ($Required) + { + $ParameterDefinePropertyList.Add("Mandatory") + } + if ($Description -ne "") + { + $ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"") + } + $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList) + # check whether completer is needed + $completer = ''; + if($Type.Split('.').Split('.')[-2] -eq 'Support') { + # If Type is an array, need to strip [] + $strippedType = $Type.Replace('[]', '') + $completer += "`n [ArgumentCompleter([${strippedType}])]" + } + $ParameterDefineScript = " + [Parameter($ParameterDefineProperty)]${completer} + [${Type}] + `$${Identifier}" + $ParameterDefineScriptList.Add($ParameterDefineScript) + $ParameterAssignScriptList.Add(" + if (`$PSBoundParameters.ContainsKey('${Identifier}')) { + `$Object.${Identifier} = `$${Identifier} + }") + } + } + $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator "," + $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator "" + + $Script = " +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an in-memory object for ${ObjectType}. +.Description +Create an in-memory object for ${ObjectType}. + +.Outputs +${ObjectTypeWithNamespace} +.Link +https://learn.microsoft.com/powershell/module/${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object +#> +function New-Az${ModulePrefix}${ObjectType}Object { + [OutputType('${ObjectTypeWithNamespace}')] + [CmdletBinding(PositionalBinding=`$false)] + Param( +${ParameterDefineScript} + ) + + process { + `$Object = [${ObjectTypeWithNamespace}]::New() +${ParameterAssignScript} + return `$Object + } +} +" + Set-Content -Path $OutputPath -Value $Script + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/custom/Az.RecoveryServicesBackup.custom.psm1 b/swaggerci/recoveryservicesbackup.DefaultTag/custom/Az.RecoveryServicesBackup.custom.psm1 new file mode 100644 index 000000000000..2a9fcaaab12e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/custom/Az.RecoveryServicesBackup.custom.psm1 @@ -0,0 +1,17 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.RecoveryServicesBackup.private.dll') + + # Load the internal module + $internalModulePath = Join-Path $PSScriptRoot '../internal/Az.RecoveryServicesBackup.internal.psm1' + if(Test-Path $internalModulePath) { + $null = Import-Module -Name $internalModulePath + } + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export script cmdlets + Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias) +# endregion diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/custom/README.md b/swaggerci/recoveryservicesbackup.DefaultTag/custom/README.md new file mode 100644 index 000000000000..55aca4b2dad0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/custom/README.md @@ -0,0 +1,41 @@ +# Custom +This directory contains custom implementation for non-generated cmdlets for the `Az.RecoveryServicesBackup` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `../exports` folder. The only generated file into this folder is the `Az.RecoveryServicesBackup.custom.psm1`. This file should not be modified. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: yes + +## Details +For `Az.RecoveryServicesBackup` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*. + +For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.RecoveryServicesBackup.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder. + +For script cmdlets, these are loaded via the `Az.RecoveryServicesBackup.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. + +## Purpose +This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `../exports` folder. + +## Usage +The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `../exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: +- Break +- DefaultProfile +- HttpPipelineAppend +- HttpPipelinePrepend +- Proxy +- ProxyCredential +- ProxyUseDefaultCredentials + +These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.RecoveryServicesBackup`. For C#, follow the usage seen in the `ProcessRecordAsync` method. + +### Attributes +For processing the cmdlets, we've created some additional attributes: +- `Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.DescriptionAttribute` + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. +- `Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.DoNotExportAttribute` + - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.RecoveryServicesBackup`. +- `Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.InternalExportAttribute` + - Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.RecoveryServicesBackup`. For more information, see [README.md](../internal/README.md) in the `../internal` folder. +- `Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ProfileAttribute` + - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/docs/Az.RecoveryServicesBackup.md b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Az.RecoveryServicesBackup.md new file mode 100644 index 000000000000..e034cdabf016 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Az.RecoveryServicesBackup.md @@ -0,0 +1,49 @@ +--- +Module Name: Az.RecoveryServicesBackup +Module Guid: 7133beef-6202-48f3-b2bb-3ec93f66e5c1 +Download Help Link: https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Az.RecoveryServicesBackup Module +## Description +Microsoft Azure PowerShell: RecoveryServicesBackup cmdlets + +## Az.RecoveryServicesBackup Cmdlets +### [Get-AzRecoveryServicesBackupAadProperty](Get-AzRecoveryServicesBackupAadProperty.md) +Fetches the AAD properties from target region BCM stamp. + +### [Get-AzRecoveryServicesBackupCrrJob](Get-AzRecoveryServicesBackupCrrJob.md) +Gets the list of CRR jobs from the target region. + +### [Get-AzRecoveryServicesBackupCrrJobDetail](Get-AzRecoveryServicesBackupCrrJobDetail.md) +Get CRR job details from target region. + +### [Get-AzRecoveryServicesBackupCrrOperationResult](Get-AzRecoveryServicesBackupCrrOperationResult.md) + + +### [Get-AzRecoveryServicesBackupCrrOperationStatus](Get-AzRecoveryServicesBackupCrrOperationStatus.md) + + +### [Get-AzRecoveryServicesBackupProtectedItemsCrr](Get-AzRecoveryServicesBackupProtectedItemsCrr.md) +Provides a pageable list of all items that are backed up within a vault. + +### [Get-AzRecoveryServicesBackupRecoveryPointAccessToken](Get-AzRecoveryServicesBackupRecoveryPointAccessToken.md) +Returns the Access token for communication between BMS and Protection service + +### [Get-AzRecoveryServicesBackupRecoveryPointsCrr](Get-AzRecoveryServicesBackupRecoveryPointsCrr.md) +Provides the information of the backed up data identified using RecoveryPointID. + +### [Get-AzRecoveryServicesBackupResourceStorageConfig](Get-AzRecoveryServicesBackupResourceStorageConfig.md) +Fetches resource storage config. + +### [Get-AzRecoveryServicesBackupUsageSummariesCrr](Get-AzRecoveryServicesBackupUsageSummariesCrr.md) +Fetches the backup management usage summaries of the vault. + +### [Start-AzRecoveryServicesBackupCrossRegionRestore](Start-AzRecoveryServicesBackupCrossRegionRestore.md) +Restores the specified backed up data in a different region as compared to where the data is backed up. + +### [Update-AzRecoveryServicesBackupResourceStorageConfig](Update-AzRecoveryServicesBackupResourceStorageConfig.md) +Updates vault storage model type. + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupAadProperty.md b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupAadProperty.md new file mode 100644 index 000000000000..458e5b0abec5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupAadProperty.md @@ -0,0 +1,147 @@ +--- +external help file: +Module Name: Az.RecoveryServicesBackup +online version: https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupaadproperty +schema: 2.0.0 +--- + +# Get-AzRecoveryServicesBackupAadProperty + +## SYNOPSIS +Fetches the AAD properties from target region BCM stamp. + +## SYNTAX + +### Get (Default) +``` +Get-AzRecoveryServicesBackupAadProperty -AzureRegion [-SubscriptionId ] [-Filter ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzRecoveryServicesBackupAadProperty -InputObject [-Filter ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Fetches the AAD properties from target region BCM stamp. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AzureRegion +Azure region to hit Api + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +OData filter options. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription Id. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupCrrJob.md b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupCrrJob.md new file mode 100644 index 000000000000..c3471ced3306 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupCrrJob.md @@ -0,0 +1,225 @@ +--- +external help file: +Module Name: Az.RecoveryServicesBackup +online version: https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupcrrjob +schema: 2.0.0 +--- + +# Get-AzRecoveryServicesBackupCrrJob + +## SYNOPSIS +Gets the list of CRR jobs from the target region. + +## SYNTAX + +### ListExpanded (Default) +``` +Get-AzRecoveryServicesBackupCrrJob -AzureRegion [-SubscriptionId ] [-Filter ] + [-SkipToken ] [-JobName ] [-ResourceId ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### List +``` +Get-AzRecoveryServicesBackupCrrJob -AzureRegion -Parameter + [-SubscriptionId ] [-Filter ] [-SkipToken ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Gets the list of CRR jobs from the target region. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AzureRegion +Azure region to hit Api + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +OData filter options. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -JobName +Job Name of the job to be fetched + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +Request object for fetching CRR jobs. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest +Parameter Sets: List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceId +Entire ARM resource id of the resource + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkipToken +skipToken Filter. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription Id. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupCrrJobDetail.md b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupCrrJobDetail.md new file mode 100644 index 000000000000..264c7222bcb6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupCrrJobDetail.md @@ -0,0 +1,224 @@ +--- +external help file: +Module Name: Az.RecoveryServicesBackup +online version: https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupcrrjobdetail +schema: 2.0.0 +--- + +# Get-AzRecoveryServicesBackupCrrJobDetail + +## SYNOPSIS +Get CRR job details from target region. + +## SYNTAX + +### GetExpanded (Default) +``` +Get-AzRecoveryServicesBackupCrrJobDetail -AzureRegion [-SubscriptionId ] + [-JobName ] [-ResourceId ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### Get +``` +Get-AzRecoveryServicesBackupCrrJobDetail -AzureRegion -Parameter + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzRecoveryServicesBackupCrrJobDetail -InputObject + -Parameter [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### GetViaIdentityExpanded +``` +Get-AzRecoveryServicesBackupCrrJobDetail -InputObject [-JobName ] + [-ResourceId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Get CRR job details from target region. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AzureRegion +Azure region to hit Api + +```yaml +Type: System.String +Parameter Sets: Get, GetExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +Parameter Sets: GetViaIdentity, GetViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -JobName +Job Name of the job to be fetched + +```yaml +Type: System.String +Parameter Sets: GetExpanded, GetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +Request object for fetching CRR jobs. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest +Parameter Sets: Get, GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceId +Entire ARM resource id of the resource + +```yaml +Type: System.String +Parameter Sets: GetExpanded, GetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription Id. + +```yaml +Type: System.String[] +Parameter Sets: Get, GetExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupCrrOperationResult.md b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupCrrOperationResult.md new file mode 100644 index 000000000000..b9e6439a159c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupCrrOperationResult.md @@ -0,0 +1,162 @@ +--- +external help file: +Module Name: Az.RecoveryServicesBackup +online version: https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupcrroperationresult +schema: 2.0.0 +--- + +# Get-AzRecoveryServicesBackupCrrOperationResult + +## SYNOPSIS + + +## SYNTAX + +### Get (Default) +``` +Get-AzRecoveryServicesBackupCrrOperationResult -AzureRegion -OperationId + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzRecoveryServicesBackupCrrOperationResult -InputObject + [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION + + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AzureRegion +Azure region to hit Api + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -OperationId +. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription Id. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupCrrOperationStatus.md b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupCrrOperationStatus.md new file mode 100644 index 000000000000..63f7b1a456a9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupCrrOperationStatus.md @@ -0,0 +1,147 @@ +--- +external help file: +Module Name: Az.RecoveryServicesBackup +online version: https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupcrroperationstatus +schema: 2.0.0 +--- + +# Get-AzRecoveryServicesBackupCrrOperationStatus + +## SYNOPSIS + + +## SYNTAX + +### Get (Default) +``` +Get-AzRecoveryServicesBackupCrrOperationStatus -AzureRegion -OperationId + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzRecoveryServicesBackupCrrOperationStatus -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION + + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AzureRegion +Azure region to hit Api + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -OperationId +. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription Id. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupProtectedItemsCrr.md b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupProtectedItemsCrr.md new file mode 100644 index 000000000000..3724d848ced2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupProtectedItemsCrr.md @@ -0,0 +1,153 @@ +--- +external help file: +Module Name: Az.RecoveryServicesBackup +online version: https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupprotecteditemscrr +schema: 2.0.0 +--- + +# Get-AzRecoveryServicesBackupProtectedItemsCrr + +## SYNOPSIS +Provides a pageable list of all items that are backed up within a vault. + +## SYNTAX + +``` +Get-AzRecoveryServicesBackupProtectedItemsCrr -ResourceGroupName -VaultName + [-SubscriptionId ] [-Filter ] [-SkipToken ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Provides a pageable list of all items that are backed up within a vault. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +OData filter options. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group where the recovery services vault is present. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkipToken +skipToken Filter. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription Id. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VaultName +The name of the recovery services vault. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupRecoveryPointAccessToken.md b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupRecoveryPointAccessToken.md new file mode 100644 index 000000000000..ed87c07dc243 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupRecoveryPointAccessToken.md @@ -0,0 +1,411 @@ +--- +external help file: +Module Name: Az.RecoveryServicesBackup +online version: https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackuprecoverypointaccesstoken +schema: 2.0.0 +--- + +# Get-AzRecoveryServicesBackupRecoveryPointAccessToken + +## SYNOPSIS +Returns the Access token for communication between BMS and Protection service + +## SYNTAX + +### GetExpanded (Default) +``` +Get-AzRecoveryServicesBackupRecoveryPointAccessToken -ContainerName -FabricName + -ProtectedItemName -RecoveryPointId -ResourceGroupName -VaultName + [-SubscriptionId ] [-Audience ] [-Authority ] [-ETag ] [-Location ] + [-ServicePrincipalClientId ] [-ServicePrincipalObjectId ] [-Tag ] + [-TenantId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Get +``` +Get-AzRecoveryServicesBackupRecoveryPointAccessToken -ContainerName -FabricName + -ProtectedItemName -RecoveryPointId -ResourceGroupName -VaultName + -Parameter [-SubscriptionId ] [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzRecoveryServicesBackupRecoveryPointAccessToken -InputObject + -Parameter [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### GetViaIdentityExpanded +``` +Get-AzRecoveryServicesBackupRecoveryPointAccessToken -InputObject + [-Audience ] [-Authority ] [-ETag ] [-Location ] + [-ServicePrincipalClientId ] [-ServicePrincipalObjectId ] [-Tag ] + [-TenantId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Returns the Access token for communication between BMS and Protection service + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -Audience +. + +```yaml +Type: System.String +Parameter Sets: GetExpanded, GetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Authority +. + +```yaml +Type: System.String +Parameter Sets: GetExpanded, GetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerName +Name of the container. + +```yaml +Type: System.String +Parameter Sets: Get, GetExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ETag +Optional ETag. + +```yaml +Type: System.String +Parameter Sets: GetExpanded, GetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FabricName +Fabric name associated with the container. + +```yaml +Type: System.String +Parameter Sets: Get, GetExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +Parameter Sets: GetViaIdentity, GetViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +Resource location. + +```yaml +Type: System.String +Parameter Sets: GetExpanded, GetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource +Parameter Sets: Get, GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProtectedItemName +Name of the Protected Item. + +```yaml +Type: System.String +Parameter Sets: Get, GetExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RecoveryPointId +Recovery Point Id + +```yaml +Type: System.String +Parameter Sets: Get, GetExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group where the recovery services vault is present. + +```yaml +Type: System.String +Parameter Sets: Get, GetExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServicePrincipalClientId +. + +```yaml +Type: System.String +Parameter Sets: GetExpanded, GetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServicePrincipalObjectId +. + +```yaml +Type: System.String +Parameter Sets: GetExpanded, GetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription Id. + +```yaml +Type: System.String[] +Parameter Sets: Get, GetExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: GetExpanded, GetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TenantId +. + +```yaml +Type: System.String +Parameter Sets: GetExpanded, GetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VaultName +The name of the recovery services vault. + +```yaml +Type: System.String +Parameter Sets: Get, GetExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupRecoveryPointsCrr.md b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupRecoveryPointsCrr.md new file mode 100644 index 000000000000..4d2db6f5f53e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupRecoveryPointsCrr.md @@ -0,0 +1,230 @@ +--- +external help file: +Module Name: Az.RecoveryServicesBackup +online version: https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackuprecoverypointscrr +schema: 2.0.0 +--- + +# Get-AzRecoveryServicesBackupRecoveryPointsCrr + +## SYNOPSIS +Provides the information of the backed up data identified using RecoveryPointID. + +## SYNTAX + +### List (Default) +``` +Get-AzRecoveryServicesBackupRecoveryPointsCrr -ContainerName -FabricName + -ProtectedItemName -ResourceGroupName -VaultName [-SubscriptionId ] + [-Filter ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzRecoveryServicesBackupRecoveryPointsCrr -ContainerName -FabricName + -ProtectedItemName -RecoveryPointId -ResourceGroupName -VaultName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzRecoveryServicesBackupRecoveryPointsCrr -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Provides the information of the backed up data identified using RecoveryPointID. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ContainerName +Container name associated with backed up item. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FabricName +Fabric name associated with backed up item. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +OData filter options. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ProtectedItemName +Backed up item name whose backup data needs to be fetched. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RecoveryPointId +RecoveryPointID represents the backed up data to be fetched. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group where the recovery services vault is present. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription Id. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VaultName +The name of the recovery services vault. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupResourceStorageConfig.md b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupResourceStorageConfig.md new file mode 100644 index 000000000000..e0b77402c1c3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupResourceStorageConfig.md @@ -0,0 +1,147 @@ +--- +external help file: +Module Name: Az.RecoveryServicesBackup +online version: https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupresourcestorageconfig +schema: 2.0.0 +--- + +# Get-AzRecoveryServicesBackupResourceStorageConfig + +## SYNOPSIS +Fetches resource storage config. + +## SYNTAX + +### Get (Default) +``` +Get-AzRecoveryServicesBackupResourceStorageConfig -ResourceGroupName -VaultName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzRecoveryServicesBackupResourceStorageConfig -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Fetches resource storage config. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group where the recovery services vault is present. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription Id. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VaultName +The name of the recovery services vault. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupUsageSummariesCrr.md b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupUsageSummariesCrr.md new file mode 100644 index 000000000000..7ced47836fd6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Get-AzRecoveryServicesBackupUsageSummariesCrr.md @@ -0,0 +1,153 @@ +--- +external help file: +Module Name: Az.RecoveryServicesBackup +online version: https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupusagesummariescrr +schema: 2.0.0 +--- + +# Get-AzRecoveryServicesBackupUsageSummariesCrr + +## SYNOPSIS +Fetches the backup management usage summaries of the vault. + +## SYNTAX + +``` +Get-AzRecoveryServicesBackupUsageSummariesCrr -ResourceGroupName -VaultName + [-SubscriptionId ] [-Filter ] [-SkipToken ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Fetches the backup management usage summaries of the vault. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +OData filter options. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group where the recovery services vault is present. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkipToken +skipToken Filter. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription Id. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VaultName +The name of the recovery services vault. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsage + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/docs/README.md b/swaggerci/recoveryservicesbackup.DefaultTag/docs/README.md new file mode 100644 index 000000000000..7cf2e13eaa70 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/docs/README.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.RecoveryServicesBackup` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `../examples` folder. + +## Info +- Modifiable: no +- Generated: all +- Committed: yes +- Packaged: yes + +## Details +The process of documentation generation loads `Az.RecoveryServicesBackup` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `../exports` folder. Additionally, when writing custom cmdlets in the `../custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `../examples` folder. \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/docs/Start-AzRecoveryServicesBackupCrossRegionRestore.md b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Start-AzRecoveryServicesBackupCrossRegionRestore.md new file mode 100644 index 000000000000..2032a34e55f3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Start-AzRecoveryServicesBackupCrossRegionRestore.md @@ -0,0 +1,273 @@ +--- +external help file: +Module Name: Az.RecoveryServicesBackup +online version: https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/start-azrecoveryservicesbackupcrossregionrestore +schema: 2.0.0 +--- + +# Start-AzRecoveryServicesBackupCrossRegionRestore + +## SYNOPSIS +Restores the specified backed up data in a different region as compared to where the data is backed up. + +## SYNTAX + +### TriggerExpanded (Default) +``` +Start-AzRecoveryServicesBackupCrossRegionRestore -AzureRegion [-SubscriptionId ] + [-CrossRegionRestoreAccessDetail ] [-RestoreRequestObjectType ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Trigger +``` +Start-AzRecoveryServicesBackupCrossRegionRestore -AzureRegion -Parameter + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### TriggerViaIdentity +``` +Start-AzRecoveryServicesBackupCrossRegionRestore -InputObject + -Parameter [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### TriggerViaIdentityExpanded +``` +Start-AzRecoveryServicesBackupCrossRegionRestore -InputObject + [-CrossRegionRestoreAccessDetail ] [-RestoreRequestObjectType ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Restores the specified backed up data in a different region as compared to where the data is backed up. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureRegion +Azure region to hit Api + +```yaml +Type: System.String +Parameter Sets: Trigger, TriggerExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CrossRegionRestoreAccessDetail +Access details for cross region restore +To construct, see NOTES section for CROSSREGIONRESTOREACCESSDETAIL properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken +Parameter Sets: TriggerExpanded, TriggerViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +Parameter Sets: TriggerViaIdentity, TriggerViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest +Parameter Sets: Trigger, TriggerViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RestoreRequestObjectType +This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + +```yaml +Type: System.String +Parameter Sets: TriggerExpanded, TriggerViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription Id. + +```yaml +Type: System.String +Parameter Sets: Trigger, TriggerExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/docs/Update-AzRecoveryServicesBackupResourceStorageConfig.md b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Update-AzRecoveryServicesBackupResourceStorageConfig.md new file mode 100644 index 000000000000..0ff94a5f98d1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/docs/Update-AzRecoveryServicesBackupResourceStorageConfig.md @@ -0,0 +1,335 @@ +--- +external help file: +Module Name: Az.RecoveryServicesBackup +online version: https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/update-azrecoveryservicesbackupresourcestorageconfig +schema: 2.0.0 +--- + +# Update-AzRecoveryServicesBackupResourceStorageConfig + +## SYNOPSIS +Updates vault storage model type. + +## SYNTAX + +### PatchExpanded (Default) +``` +Update-AzRecoveryServicesBackupResourceStorageConfig -ResourceGroupName -VaultName + [-SubscriptionId ] [-CrossRegionRestoreFlag] [-ETag ] [-Location ] + [-StorageModelType ] [-StorageType ] [-StorageTypeState ] + [-Tag ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Patch +``` +Update-AzRecoveryServicesBackupResourceStorageConfig -ResourceGroupName -VaultName + -Parameter [-SubscriptionId ] [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### PatchViaIdentity +``` +Update-AzRecoveryServicesBackupResourceStorageConfig -InputObject + -Parameter [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### PatchViaIdentityExpanded +``` +Update-AzRecoveryServicesBackupResourceStorageConfig -InputObject + [-CrossRegionRestoreFlag] [-ETag ] [-Location ] [-StorageModelType ] + [-StorageType ] [-StorageTypeState ] [-Tag ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Updates vault storage model type. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -CrossRegionRestoreFlag +Opt in details of Cross Region Restore feature. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: PatchExpanded, PatchViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ETag +Optional ETag. + +```yaml +Type: System.String +Parameter Sets: PatchExpanded, PatchViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +Parameter Sets: PatchViaIdentity, PatchViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +Resource location. + +```yaml +Type: System.String +Parameter Sets: PatchExpanded, PatchViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +The resource storage details. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource +Parameter Sets: Patch, PatchViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group where the recovery services vault is present. + +```yaml +Type: System.String +Parameter Sets: Patch, PatchExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageModelType +Storage type + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType +Parameter Sets: PatchExpanded, PatchViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageType +Storage type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType +Parameter Sets: PatchExpanded, PatchViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageTypeState +Locked or Unlocked. +Once a machine is registered against a resource, the storageTypeState is always Locked. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState +Parameter Sets: PatchExpanded, PatchViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription Id. + +```yaml +Type: System.String +Parameter Sets: Patch, PatchExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: PatchExpanded, PatchViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VaultName +The name of the recovery services vault. + +```yaml +Type: System.String +Parameter Sets: Patch, PatchExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource + +### Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupAadProperty.md b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupAadProperty.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupAadProperty.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupCrrJob.md b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupCrrJob.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupCrrJob.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupCrrJobDetail.md b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupCrrJobDetail.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupCrrJobDetail.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupCrrOperationResult.md b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupCrrOperationResult.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupCrrOperationResult.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupCrrOperationStatus.md b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupCrrOperationStatus.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupCrrOperationStatus.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupProtectedItemsCrr.md b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupProtectedItemsCrr.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupProtectedItemsCrr.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupRecoveryPointAccessToken.md b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupRecoveryPointAccessToken.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupRecoveryPointAccessToken.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupRecoveryPointsCrr.md b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupRecoveryPointsCrr.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupRecoveryPointsCrr.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupResourceStorageConfig.md b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupResourceStorageConfig.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupResourceStorageConfig.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupUsageSummariesCrr.md b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupUsageSummariesCrr.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Get-AzRecoveryServicesBackupUsageSummariesCrr.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/examples/Start-AzRecoveryServicesBackupCrossRegionRestore.md b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Start-AzRecoveryServicesBackupCrossRegionRestore.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Start-AzRecoveryServicesBackupCrossRegionRestore.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/examples/Update-AzRecoveryServicesBackupResourceStorageConfig.md b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Update-AzRecoveryServicesBackupResourceStorageConfig.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/examples/Update-AzRecoveryServicesBackupResourceStorageConfig.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/export-surface.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/export-surface.ps1 new file mode 100644 index 000000000000..02816f2bdae2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/export-surface.ps1 @@ -0,0 +1,33 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$IncludeGeneralParameters, [switch]$UseExpandedFormat) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$dll = Join-Path $PSScriptRoot 'bin/Az.RecoveryServicesBackup.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} +$null = Import-Module -Name $dll + +$moduleName = 'Az.RecoveryServicesBackup' +$exportsFolder = Join-Path $PSScriptRoot 'exports' +$resourcesFolder = Join-Path $PSScriptRoot 'resources' + +Export-CmdletSurface -ModuleName $moduleName -CmdletFolder $exportsFolder -OutputFolder $resourcesFolder -IncludeGeneralParameters $IncludeGeneralParameters.IsPresent -UseExpandedFormat $UseExpandedFormat.IsPresent +Write-Host -ForegroundColor Green "CmdletSurface file(s) created in '$resourcesFolder'" + +Export-ModelSurface -OutputFolder $resourcesFolder -UseExpandedFormat $UseExpandedFormat.IsPresent +Write-Host -ForegroundColor Green "ModelSurface file created in '$resourcesFolder'" + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupAadProperty.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupAadProperty.ps1 new file mode 100644 index 000000000000..6716a99a8a5e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupAadProperty.ps1 @@ -0,0 +1,207 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Fetches the AAD properties from target region BCM stamp. +.Description +Fetches the AAD properties from target region BCM stamp. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupaadproperty +#> +function Get-AzRecoveryServicesBackupAadProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Azure region to hit Api + ${AzureRegion}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # OData filter options. + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupAadProperty_Get'; + GetViaIdentity = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupAadProperty_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupCrrJob.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupCrrJob.ps1 new file mode 100644 index 000000000000..8a5c94a24f61 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupCrrJob.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the list of CRR jobs from the target region. +.Description +Gets the list of CRR jobs from the target region. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +PARAMETER : Request object for fetching CRR jobs. + [JobName ]: Job Name of the job to be fetched + [ResourceId ]: Entire ARM resource id of the resource +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupcrrjob +#> +function Get-AzRecoveryServicesBackupCrrJob { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource])] +[CmdletBinding(DefaultParameterSetName='ListExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Azure region to hit Api + ${AzureRegion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # OData filter options. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # skipToken Filter. + ${SkipToken}, + + [Parameter(ParameterSetName='List', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest] + # Request object for fetching CRR jobs. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Job Name of the job to be fetched + ${JobName}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Entire ARM resource id of the resource + ${ResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrJob_List'; + ListExpanded = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrJob_ListExpanded'; + } + if (('List', 'ListExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupCrrJobDetail.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupCrrJobDetail.ps1 new file mode 100644 index 000000000000..9fada321c250 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupCrrJobDetail.ps1 @@ -0,0 +1,234 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get CRR job details from target region. +.Description +Get CRR job details from target region. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. + +PARAMETER : Request object for fetching CRR jobs. + [JobName ]: Job Name of the job to be fetched + [ResourceId ]: Entire ARM resource id of the resource +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupcrrjobdetail +#> +function Get-AzRecoveryServicesBackupCrrJobDetail { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource])] +[CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Azure region to hit Api + ${AzureRegion}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Get', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest] + # Request object for fetching CRR jobs. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Job Name of the job to be fetched + ${JobName}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Entire ARM resource id of the resource + ${ResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrJobDetail_Get'; + GetExpanded = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrJobDetail_GetExpanded'; + GetViaIdentity = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrJobDetail_GetViaIdentity'; + GetViaIdentityExpanded = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrJobDetail_GetViaIdentityExpanded'; + } + if (('Get', 'GetExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupCrrOperationResult.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupCrrOperationResult.ps1 new file mode 100644 index 000000000000..a550499cad5c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupCrrOperationResult.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis + +.Description + +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupcrroperationresult +#> +function Get-AzRecoveryServicesBackupCrrOperationResult { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Azure region to hit Api + ${AzureRegion}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # . + ${OperationId}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrOperationResult_Get'; + GetViaIdentity = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrOperationResult_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupCrrOperationStatus.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupCrrOperationStatus.ps1 new file mode 100644 index 000000000000..76cfad1dbc40 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupCrrOperationStatus.ps1 @@ -0,0 +1,207 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis + +.Description + +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupcrroperationstatus +#> +function Get-AzRecoveryServicesBackupCrrOperationStatus { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Azure region to hit Api + ${AzureRegion}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # . + ${OperationId}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrOperationStatus_Get'; + GetViaIdentity = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrOperationStatus_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupProtectedItemsCrr.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupProtectedItemsCrr.ps1 new file mode 100644 index 000000000000..571c4de986dd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupProtectedItemsCrr.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Provides a pageable list of all items that are backed up within a vault. +.Description +Provides a pageable list of all items that are backed up within a vault. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupprotecteditemscrr +#> +function Get-AzRecoveryServicesBackupProtectedItemsCrr { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the resource group where the recovery services vault is present. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the recovery services vault. + ${VaultName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # OData filter options. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # skipToken Filter. + ${SkipToken}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupProtectedItemsCrr_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupRecoveryPointAccessToken.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupRecoveryPointAccessToken.ps1 new file mode 100644 index 000000000000..5e598df3d249 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupRecoveryPointAccessToken.ps1 @@ -0,0 +1,325 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the Access token for communication between BMS and Protection service +.Description +Returns the Access token for communication between BMS and Protection service +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. + +PARAMETER : . + [ETag ]: Optional ETag. + [Location ]: Resource location. + [Tag ]: Resource tags. + [(Any) ]: This indicates any property can be added to this object. + [Audience ]: + [Authority ]: + [ServicePrincipalClientId ]: + [ServicePrincipalObjectId ]: + [TenantId ]: +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackuprecoverypointaccesstoken +#> +function Get-AzRecoveryServicesBackupRecoveryPointAccessToken { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource])] +[CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Name of the container. + ${ContainerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Fabric name associated with the container. + ${FabricName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Name of the Protected Item. + ${ProtectedItemName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Recovery Point Id + ${RecoveryPointId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the resource group where the recovery services vault is present. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the recovery services vault. + ${VaultName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Get', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource] + # . + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # . + ${Audience}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # . + ${Authority}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Optional ETag. + ${ETag}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Resource location. + ${Location}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # . + ${ServicePrincipalClientId}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # . + ${ServicePrincipalObjectId}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # . + ${TenantId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupRecoveryPointAccessToken_Get'; + GetExpanded = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupRecoveryPointAccessToken_GetExpanded'; + GetViaIdentity = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentity'; + GetViaIdentityExpanded = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentityExpanded'; + } + if (('Get', 'GetExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupRecoveryPointsCrr.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupRecoveryPointsCrr.ps1 new file mode 100644 index 000000000000..ae8ff8351c29 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupRecoveryPointsCrr.ps1 @@ -0,0 +1,244 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Provides the information of the backed up data identified using RecoveryPointID. +.Description +Provides the information of the backed up data identified using RecoveryPointID. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackuprecoverypointscrr +#> +function Get-AzRecoveryServicesBackupRecoveryPointsCrr { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Container name associated with backed up item. + ${ContainerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Fabric name associated with backed up item. + ${FabricName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Backed up item name whose backup data needs to be fetched. + ${ProtectedItemName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # RecoveryPointID represents the backed up data to be fetched. + ${RecoveryPointId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the resource group where the recovery services vault is present. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the recovery services vault. + ${VaultName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # OData filter options. + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupRecoveryPointsCrr_Get'; + GetViaIdentity = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupRecoveryPointsCrr_GetViaIdentity'; + List = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupRecoveryPointsCrr_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupResourceStorageConfig.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupResourceStorageConfig.ps1 new file mode 100644 index 000000000000..27a902e470df --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupResourceStorageConfig.ps1 @@ -0,0 +1,207 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Fetches resource storage config. +.Description +Fetches resource storage config. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupresourcestorageconfig +#> +function Get-AzRecoveryServicesBackupResourceStorageConfig { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the resource group where the recovery services vault is present. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the recovery services vault. + ${VaultName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupResourceStorageConfig_Get'; + GetViaIdentity = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupResourceStorageConfig_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupUsageSummariesCrr.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupUsageSummariesCrr.ps1 new file mode 100644 index 000000000000..1161306cd340 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Get-AzRecoveryServicesBackupUsageSummariesCrr.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Fetches the backup management usage summaries of the vault. +.Description +Fetches the backup management usage summaries of the vault. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsage +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupusagesummariescrr +#> +function Get-AzRecoveryServicesBackupUsageSummariesCrr { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsage])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the resource group where the recovery services vault is present. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the recovery services vault. + ${VaultName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # OData filter options. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # skipToken Filter. + ${SkipToken}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupUsageSummariesCrr_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/exports/ProxyCmdletDefinitions.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/exports/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..424e7fa3d5a5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/exports/ProxyCmdletDefinitions.ps1 @@ -0,0 +1,2765 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Fetches the AAD properties from target region BCM stamp. +.Description +Fetches the AAD properties from target region BCM stamp. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupaadproperty +#> +function Get-AzRecoveryServicesBackupAadProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Azure region to hit Api + ${AzureRegion}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # OData filter options. + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupAadProperty_Get'; + GetViaIdentity = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupAadProperty_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get CRR job details from target region. +.Description +Get CRR job details from target region. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. + +PARAMETER : Request object for fetching CRR jobs. + [JobName ]: Job Name of the job to be fetched + [ResourceId ]: Entire ARM resource id of the resource +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupcrrjobdetail +#> +function Get-AzRecoveryServicesBackupCrrJobDetail { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource])] +[CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Azure region to hit Api + ${AzureRegion}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Get', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest] + # Request object for fetching CRR jobs. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Job Name of the job to be fetched + ${JobName}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Entire ARM resource id of the resource + ${ResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrJobDetail_Get'; + GetExpanded = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrJobDetail_GetExpanded'; + GetViaIdentity = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrJobDetail_GetViaIdentity'; + GetViaIdentityExpanded = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrJobDetail_GetViaIdentityExpanded'; + } + if (('Get', 'GetExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the list of CRR jobs from the target region. +.Description +Gets the list of CRR jobs from the target region. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +PARAMETER : Request object for fetching CRR jobs. + [JobName ]: Job Name of the job to be fetched + [ResourceId ]: Entire ARM resource id of the resource +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupcrrjob +#> +function Get-AzRecoveryServicesBackupCrrJob { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource])] +[CmdletBinding(DefaultParameterSetName='ListExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Azure region to hit Api + ${AzureRegion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # OData filter options. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # skipToken Filter. + ${SkipToken}, + + [Parameter(ParameterSetName='List', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest] + # Request object for fetching CRR jobs. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Job Name of the job to be fetched + ${JobName}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Entire ARM resource id of the resource + ${ResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrJob_List'; + ListExpanded = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrJob_ListExpanded'; + } + if (('List', 'ListExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis + +.Description + +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupcrroperationresult +#> +function Get-AzRecoveryServicesBackupCrrOperationResult { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Azure region to hit Api + ${AzureRegion}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # . + ${OperationId}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrOperationResult_Get'; + GetViaIdentity = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrOperationResult_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis + +.Description + +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupcrroperationstatus +#> +function Get-AzRecoveryServicesBackupCrrOperationStatus { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Azure region to hit Api + ${AzureRegion}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # . + ${OperationId}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrOperationStatus_Get'; + GetViaIdentity = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupCrrOperationStatus_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Provides a pageable list of all items that are backed up within a vault. +.Description +Provides a pageable list of all items that are backed up within a vault. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupprotecteditemscrr +#> +function Get-AzRecoveryServicesBackupProtectedItemsCrr { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the resource group where the recovery services vault is present. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the recovery services vault. + ${VaultName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # OData filter options. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # skipToken Filter. + ${SkipToken}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupProtectedItemsCrr_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the Access token for communication between BMS and Protection service +.Description +Returns the Access token for communication between BMS and Protection service +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. + +PARAMETER : . + [ETag ]: Optional ETag. + [Location ]: Resource location. + [Tag ]: Resource tags. + [(Any) ]: This indicates any property can be added to this object. + [Audience ]: + [Authority ]: + [ServicePrincipalClientId ]: + [ServicePrincipalObjectId ]: + [TenantId ]: +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackuprecoverypointaccesstoken +#> +function Get-AzRecoveryServicesBackupRecoveryPointAccessToken { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource])] +[CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Name of the container. + ${ContainerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Fabric name associated with the container. + ${FabricName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Name of the Protected Item. + ${ProtectedItemName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Recovery Point Id + ${RecoveryPointId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the resource group where the recovery services vault is present. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the recovery services vault. + ${VaultName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Get', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource] + # . + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # . + ${Audience}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # . + ${Authority}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Optional ETag. + ${ETag}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Resource location. + ${Location}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # . + ${ServicePrincipalClientId}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # . + ${ServicePrincipalObjectId}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # . + ${TenantId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupRecoveryPointAccessToken_Get'; + GetExpanded = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupRecoveryPointAccessToken_GetExpanded'; + GetViaIdentity = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentity'; + GetViaIdentityExpanded = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentityExpanded'; + } + if (('Get', 'GetExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Provides the information of the backed up data identified using RecoveryPointID. +.Description +Provides the information of the backed up data identified using RecoveryPointID. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackuprecoverypointscrr +#> +function Get-AzRecoveryServicesBackupRecoveryPointsCrr { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Container name associated with backed up item. + ${ContainerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Fabric name associated with backed up item. + ${FabricName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Backed up item name whose backup data needs to be fetched. + ${ProtectedItemName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # RecoveryPointID represents the backed up data to be fetched. + ${RecoveryPointId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the resource group where the recovery services vault is present. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the recovery services vault. + ${VaultName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # OData filter options. + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupRecoveryPointsCrr_Get'; + GetViaIdentity = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupRecoveryPointsCrr_GetViaIdentity'; + List = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupRecoveryPointsCrr_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Fetches resource storage config. +.Description +Fetches resource storage config. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupresourcestorageconfig +#> +function Get-AzRecoveryServicesBackupResourceStorageConfig { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the resource group where the recovery services vault is present. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the recovery services vault. + ${VaultName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupResourceStorageConfig_Get'; + GetViaIdentity = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupResourceStorageConfig_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Fetches the backup management usage summaries of the vault. +.Description +Fetches the backup management usage summaries of the vault. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsage +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/get-azrecoveryservicesbackupusagesummariescrr +#> +function Get-AzRecoveryServicesBackupUsageSummariesCrr { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsage])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the resource group where the recovery services vault is present. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the recovery services vault. + ${VaultName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription Id. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # OData filter options. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Query')] + [System.String] + # skipToken Filter. + ${SkipToken}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.RecoveryServicesBackup.private\Get-AzRecoveryServicesBackupUsageSummariesCrr_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Restores the specified backed up data in a different region as compared to where the data is backed up. +.Description +Restores the specified backed up data in a different region as compared to where the data is backed up. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +CROSSREGIONRESTOREACCESSDETAIL : Access details for cross region restore + ObjectType : Type of the specific object - used for deserializing + [AccessTokenString ]: Access token used for authentication + [BackupManagementType ]: Backup Management Type + [BmsActiveRegion ]: Active region name of BMS Stamp + [ContainerName ]: Container Unique name + [ContainerType ]: Container Type + [CoordinatorServiceStampId ]: CoordinatorServiceStampId to be used by BCM in restore call + [CoordinatorServiceStampUri ]: CoordinatorServiceStampUri to be used by BCM in restore call + [DatasourceContainerName ]: Datasource Container Unique Name + [DatasourceId ]: Datasource Id + [DatasourceName ]: Datasource Friendly Name + [DatasourceType ]: Datasource Type + [ProtectionContainerId ]: Protected item container id + [ProtectionServiceStampId ]: ProtectionServiceStampId to be used by BCM in restore call + [ProtectionServiceStampUri ]: ProtectionServiceStampUri to be used by BCM in restore call + [RecoveryPointId ]: Recovery Point Id + [RecoveryPointTime ]: Recovery Point Time + [ResourceGroupName ]: Resource Group name of the source vault + [ResourceId ]: Resource Id of the source vault + [ResourceName ]: Resource Name of the source vault + [RpIsManagedVirtualMachine ]: Recovery point information: Managed virtual machine + [RpOriginalSaOption ]: Recovery point information: Original SA option + [RpTierInformation ]: Recovery point Tier Information + [(Any) ]: This indicates any property can be added to this object. + [RpVMSizeDescription ]: Recovery point information: VM size description + [SubscriptionId ]: Subscription Id of the source vault + [TokenExtendedInformation ]: Extended Information about the token like FileSpec etc. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. + +PARAMETER : . + [CrossRegionRestoreAccessDetail ]: Access details for cross region restore + ObjectType : Type of the specific object - used for deserializing + [AccessTokenString ]: Access token used for authentication + [BackupManagementType ]: Backup Management Type + [BmsActiveRegion ]: Active region name of BMS Stamp + [ContainerName ]: Container Unique name + [ContainerType ]: Container Type + [CoordinatorServiceStampId ]: CoordinatorServiceStampId to be used by BCM in restore call + [CoordinatorServiceStampUri ]: CoordinatorServiceStampUri to be used by BCM in restore call + [DatasourceContainerName ]: Datasource Container Unique Name + [DatasourceId ]: Datasource Id + [DatasourceName ]: Datasource Friendly Name + [DatasourceType ]: Datasource Type + [ProtectionContainerId ]: Protected item container id + [ProtectionServiceStampId ]: ProtectionServiceStampId to be used by BCM in restore call + [ProtectionServiceStampUri ]: ProtectionServiceStampUri to be used by BCM in restore call + [RecoveryPointId ]: Recovery Point Id + [RecoveryPointTime ]: Recovery Point Time + [ResourceGroupName ]: Resource Group name of the source vault + [ResourceId ]: Resource Id of the source vault + [ResourceName ]: Resource Name of the source vault + [RpIsManagedVirtualMachine ]: Recovery point information: Managed virtual machine + [RpOriginalSaOption ]: Recovery point information: Original SA option + [RpTierInformation ]: Recovery point Tier Information + [(Any) ]: This indicates any property can be added to this object. + [RpVMSizeDescription ]: Recovery point information: VM size description + [SubscriptionId ]: Subscription Id of the source vault + [TokenExtendedInformation ]: Extended Information about the token like FileSpec etc. + [RestoreRequestObjectType ]: This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/start-azrecoveryservicesbackupcrossregionrestore +#> +function Start-AzRecoveryServicesBackupCrossRegionRestore { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='TriggerExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Trigger', Mandatory)] + [Parameter(ParameterSetName='TriggerExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Azure region to hit Api + ${AzureRegion}, + + [Parameter(ParameterSetName='Trigger')] + [Parameter(ParameterSetName='TriggerExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='TriggerViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='TriggerViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Trigger', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='TriggerViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest] + # . + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='TriggerExpanded')] + [Parameter(ParameterSetName='TriggerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken] + # Access details for cross region restore + # To construct, see NOTES section for CROSSREGIONRESTOREACCESSDETAIL properties and create a hash table. + ${CrossRegionRestoreAccessDetail}, + + [Parameter(ParameterSetName='TriggerExpanded')] + [Parameter(ParameterSetName='TriggerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + ${RestoreRequestObjectType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Trigger = 'Az.RecoveryServicesBackup.private\Start-AzRecoveryServicesBackupCrossRegionRestore_Trigger'; + TriggerExpanded = 'Az.RecoveryServicesBackup.private\Start-AzRecoveryServicesBackupCrossRegionRestore_TriggerExpanded'; + TriggerViaIdentity = 'Az.RecoveryServicesBackup.private\Start-AzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentity'; + TriggerViaIdentityExpanded = 'Az.RecoveryServicesBackup.private\Start-AzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentityExpanded'; + } + if (('Trigger', 'TriggerExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Updates vault storage model type. +.Description +Updates vault storage model type. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. + +PARAMETER : The resource storage details. + [ETag ]: Optional ETag. + [Location ]: Resource location. + [Tag ]: Resource tags. + [(Any) ]: This indicates any property can be added to this object. + [CrossRegionRestoreFlag ]: Opt in details of Cross Region Restore feature. + [StorageModelType ]: Storage type + [StorageType ]: Storage type. + [StorageTypeState ]: Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/update-azrecoveryservicesbackupresourcestorageconfig +#> +function Update-AzRecoveryServicesBackupResourceStorageConfig { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='PatchExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the resource group where the recovery services vault is present. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Patch')] + [Parameter(ParameterSetName='PatchExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the recovery services vault. + ${VaultName}, + + [Parameter(ParameterSetName='PatchViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PatchViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Patch', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PatchViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource] + # The resource storage details. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Opt in details of Cross Region Restore feature. + ${CrossRegionRestoreFlag}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Optional ETag. + ${ETag}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Resource location. + ${Location}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType])] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType] + # Storage type + ${StorageModelType}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType])] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType] + # Storage type. + ${StorageType}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState])] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState] + # Locked or Unlocked. + # Once a machine is registered against a resource, the storageTypeState is always Locked. + ${StorageTypeState}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Patch = 'Az.RecoveryServicesBackup.private\Update-AzRecoveryServicesBackupResourceStorageConfig_Patch'; + PatchExpanded = 'Az.RecoveryServicesBackup.private\Update-AzRecoveryServicesBackupResourceStorageConfig_PatchExpanded'; + PatchViaIdentity = 'Az.RecoveryServicesBackup.private\Update-AzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentity'; + PatchViaIdentityExpanded = 'Az.RecoveryServicesBackup.private\Update-AzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentityExpanded'; + } + if (('Patch', 'PatchExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/exports/README.md b/swaggerci/recoveryservicesbackup.DefaultTag/exports/README.md new file mode 100644 index 000000000000..47e0e2c4c806 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/exports/README.md @@ -0,0 +1,20 @@ +# Exports +This directory contains the cmdlets *exported by* `Az.RecoveryServicesBackup`. No other cmdlets in this repository are directly exported. What that means is the `Az.RecoveryServicesBackup` module will run [Export-ModuleMember](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `../custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`../bin/Az.RecoveryServicesBackup.private.dll`) and from the `../custom/Az.RecoveryServicesBackup.custom.psm1` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [README.md](../internal/README.md) in the `../internal` folder. + +## Purpose +We generate script cmdlets out of the binary cmdlets and custom cmdlets. The format of script cmdlets are simplistic; thus, easier to generate at build time. Generating the cmdlets is required as to allow merging of generated binary, hand-written binary, and hand-written custom cmdlets. For Azure cmdlets, having script cmdlets simplifies the mechanism for exporting Azure profiles. + +## Structure +The cmdlets generated here will flat in the directory (no sub-folders) as long as there are no Azure profiles specified for any cmdlets. Azure profiles (the `Profiles` attribute) is only applied when generating with the `--azure` attribute (or `azure: true` in the configuration). When Azure profiles are applied, the folder structure has a folder per profile. Each profile folder has only those cmdlets that apply to that profile. + +## Usage +When `./Az.RecoveryServicesBackup.psm1` is loaded, it dynamically exports cmdlets here based on the folder structure and on the selected profile. If there are no sub-folders, it exports all cmdlets at the root of this folder. If there are sub-folders, it checks to see the selected profile. If no profile is selected, it exports the cmdlets in the last sub-folder (alphabetically). If a profile is selected, it exports the cmdlets in the sub-folder that matches the profile name. If there is no sub-folder that matches the profile name, it exports no cmdlets and writes a warning message. \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/exports/Start-AzRecoveryServicesBackupCrossRegionRestore.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Start-AzRecoveryServicesBackupCrossRegionRestore.ps1 new file mode 100644 index 000000000000..d33db47ecd76 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Start-AzRecoveryServicesBackupCrossRegionRestore.ps1 @@ -0,0 +1,309 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Restores the specified backed up data in a different region as compared to where the data is backed up. +.Description +Restores the specified backed up data in a different region as compared to where the data is backed up. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +CROSSREGIONRESTOREACCESSDETAIL : Access details for cross region restore + ObjectType : Type of the specific object - used for deserializing + [AccessTokenString ]: Access token used for authentication + [BackupManagementType ]: Backup Management Type + [BmsActiveRegion ]: Active region name of BMS Stamp + [ContainerName ]: Container Unique name + [ContainerType ]: Container Type + [CoordinatorServiceStampId ]: CoordinatorServiceStampId to be used by BCM in restore call + [CoordinatorServiceStampUri ]: CoordinatorServiceStampUri to be used by BCM in restore call + [DatasourceContainerName ]: Datasource Container Unique Name + [DatasourceId ]: Datasource Id + [DatasourceName ]: Datasource Friendly Name + [DatasourceType ]: Datasource Type + [ProtectionContainerId ]: Protected item container id + [ProtectionServiceStampId ]: ProtectionServiceStampId to be used by BCM in restore call + [ProtectionServiceStampUri ]: ProtectionServiceStampUri to be used by BCM in restore call + [RecoveryPointId ]: Recovery Point Id + [RecoveryPointTime ]: Recovery Point Time + [ResourceGroupName ]: Resource Group name of the source vault + [ResourceId ]: Resource Id of the source vault + [ResourceName ]: Resource Name of the source vault + [RpIsManagedVirtualMachine ]: Recovery point information: Managed virtual machine + [RpOriginalSaOption ]: Recovery point information: Original SA option + [RpTierInformation ]: Recovery point Tier Information + [(Any) ]: This indicates any property can be added to this object. + [RpVMSizeDescription ]: Recovery point information: VM size description + [SubscriptionId ]: Subscription Id of the source vault + [TokenExtendedInformation ]: Extended Information about the token like FileSpec etc. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. + +PARAMETER : . + [CrossRegionRestoreAccessDetail ]: Access details for cross region restore + ObjectType : Type of the specific object - used for deserializing + [AccessTokenString ]: Access token used for authentication + [BackupManagementType ]: Backup Management Type + [BmsActiveRegion ]: Active region name of BMS Stamp + [ContainerName ]: Container Unique name + [ContainerType ]: Container Type + [CoordinatorServiceStampId ]: CoordinatorServiceStampId to be used by BCM in restore call + [CoordinatorServiceStampUri ]: CoordinatorServiceStampUri to be used by BCM in restore call + [DatasourceContainerName ]: Datasource Container Unique Name + [DatasourceId ]: Datasource Id + [DatasourceName ]: Datasource Friendly Name + [DatasourceType ]: Datasource Type + [ProtectionContainerId ]: Protected item container id + [ProtectionServiceStampId ]: ProtectionServiceStampId to be used by BCM in restore call + [ProtectionServiceStampUri ]: ProtectionServiceStampUri to be used by BCM in restore call + [RecoveryPointId ]: Recovery Point Id + [RecoveryPointTime ]: Recovery Point Time + [ResourceGroupName ]: Resource Group name of the source vault + [ResourceId ]: Resource Id of the source vault + [ResourceName ]: Resource Name of the source vault + [RpIsManagedVirtualMachine ]: Recovery point information: Managed virtual machine + [RpOriginalSaOption ]: Recovery point information: Original SA option + [RpTierInformation ]: Recovery point Tier Information + [(Any) ]: This indicates any property can be added to this object. + [RpVMSizeDescription ]: Recovery point information: VM size description + [SubscriptionId ]: Subscription Id of the source vault + [TokenExtendedInformation ]: Extended Information about the token like FileSpec etc. + [RestoreRequestObjectType ]: This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/start-azrecoveryservicesbackupcrossregionrestore +#> +function Start-AzRecoveryServicesBackupCrossRegionRestore { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='TriggerExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Trigger', Mandatory)] + [Parameter(ParameterSetName='TriggerExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # Azure region to hit Api + ${AzureRegion}, + + [Parameter(ParameterSetName='Trigger')] + [Parameter(ParameterSetName='TriggerExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='TriggerViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='TriggerViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Trigger', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='TriggerViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest] + # . + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='TriggerExpanded')] + [Parameter(ParameterSetName='TriggerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken] + # Access details for cross region restore + # To construct, see NOTES section for CROSSREGIONRESTOREACCESSDETAIL properties and create a hash table. + ${CrossRegionRestoreAccessDetail}, + + [Parameter(ParameterSetName='TriggerExpanded')] + [Parameter(ParameterSetName='TriggerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + ${RestoreRequestObjectType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Trigger = 'Az.RecoveryServicesBackup.private\Start-AzRecoveryServicesBackupCrossRegionRestore_Trigger'; + TriggerExpanded = 'Az.RecoveryServicesBackup.private\Start-AzRecoveryServicesBackupCrossRegionRestore_TriggerExpanded'; + TriggerViaIdentity = 'Az.RecoveryServicesBackup.private\Start-AzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentity'; + TriggerViaIdentityExpanded = 'Az.RecoveryServicesBackup.private\Start-AzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentityExpanded'; + } + if (('Trigger', 'TriggerExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/exports/Update-AzRecoveryServicesBackupResourceStorageConfig.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Update-AzRecoveryServicesBackupResourceStorageConfig.ps1 new file mode 100644 index 000000000000..40b00c08d97d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/exports/Update-AzRecoveryServicesBackupResourceStorageConfig.ps1 @@ -0,0 +1,293 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Updates vault storage model type. +.Description +Updates vault storage model type. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureRegion ]: Azure region to hit Api + [ContainerName ]: Name of the container. + [FabricName ]: Fabric name associated with the container. + [Id ]: Resource identity path + [OperationId ]: + [ProtectedItemName ]: Name of the Protected Item. + [RecoveryPointId ]: Recovery Point Id + [ResourceGroupName ]: The name of the resource group where the recovery services vault is present. + [SubscriptionId ]: The subscription Id. + [VaultName ]: The name of the recovery services vault. + +PARAMETER : The resource storage details. + [ETag ]: Optional ETag. + [Location ]: Resource location. + [Tag ]: Resource tags. + [(Any) ]: This indicates any property can be added to this object. + [CrossRegionRestoreFlag ]: Opt in details of Cross Region Restore feature. + [StorageModelType ]: Storage type + [StorageType ]: Storage type. + [StorageTypeState ]: Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. +.Link +https://learn.microsoft.com/powershell/module/az.recoveryservicesbackup/update-azrecoveryservicesbackupresourcestorageconfig +#> +function Update-AzRecoveryServicesBackupResourceStorageConfig { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='PatchExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the resource group where the recovery services vault is present. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Patch')] + [Parameter(ParameterSetName='PatchExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription Id. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [System.String] + # The name of the recovery services vault. + ${VaultName}, + + [Parameter(ParameterSetName='PatchViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PatchViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Patch', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PatchViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource] + # The resource storage details. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Opt in details of Cross Region Restore feature. + ${CrossRegionRestoreFlag}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Optional ETag. + ${ETag}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [System.String] + # Resource location. + ${Location}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType])] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType] + # Storage type + ${StorageModelType}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType])] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType] + # Storage type. + ${StorageType}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState])] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState] + # Locked or Unlocked. + # Once a machine is registered against a resource, the storageTypeState is always Locked. + ${StorageTypeState}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Patch = 'Az.RecoveryServicesBackup.private\Update-AzRecoveryServicesBackupResourceStorageConfig_Patch'; + PatchExpanded = 'Az.RecoveryServicesBackup.private\Update-AzRecoveryServicesBackupResourceStorageConfig_PatchExpanded'; + PatchViaIdentity = 'Az.RecoveryServicesBackup.private\Update-AzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentity'; + PatchViaIdentityExpanded = 'Az.RecoveryServicesBackup.private\Update-AzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentityExpanded'; + } + if (('Patch', 'PatchExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generate-help.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/generate-help.ps1 new file mode 100644 index 000000000000..053c2e5caf06 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generate-help.ps1 @@ -0,0 +1,66 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$exportsFolder = Join-Path $PSScriptRoot 'exports' +if(-not (Test-Path $exportsFolder)) { + Write-Error "Exports folder '$exportsFolder' was not found." +} + +$directories = Get-ChildItem -Directory -Path $exportsFolder +$hasProfiles = ($directories | Measure-Object).Count -gt 0 +if(-not $hasProfiles) { + $directories = Get-Item -Path $exportsFolder +} + +$docsFolder = Join-Path $PSScriptRoot 'docs' +if(Test-Path $docsFolder) { + $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $docsFolder -ErrorAction SilentlyContinue +$examplesFolder = Join-Path $PSScriptRoot 'examples' + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.RecoveryServicesBackup.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +# Load DLL to use build-time cmdlets +Import-Module -Name $modulePath +Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.RecoveryServicesBackup.private.dll') +$instance = [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module]::Instance +# Module info is shared per profile +$moduleInfo = Get-Module -Name $moduleName + +foreach($directory in $directories) +{ + if($hasProfiles) { + Select-AzProfile -Name $directory.Name + } + # Reload module per profile + Import-Module -Name $modulePath -Force + + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $directory.FullName + $cmdletHelpInfo = $cmdletNames | ForEach-Object { Get-Help -Name $_ -Full } + $cmdletFunctionInfo = Get-ScriptCmdlet -ScriptFolder $directory.FullName -AsFunctionInfo + + $docsPath = Join-Path $docsFolder $directory.Name + $null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue + $examplesPath = Join-Path $examplesFolder $directory.Name + $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true') + Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath -AddComplexInterfaceInfo:$addComplexInterfaceInfo + Write-Host -ForegroundColor Green "Created documentation in '$docsPath'" +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generate-portal-ux.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/generate-portal-ux.ps1 new file mode 100644 index 000000000000..c23691a9a2c4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generate-portal-ux.ps1 @@ -0,0 +1,376 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# +# This Script will create a folder dedicated to Azure-specific content and includes metadata files essential for enhancing the user experience (UX) within the Azure portal. +# These files are utilized by the Azure portal to effectively present the usage of cmdlets related to specific resources on portal pages. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$moduleName = 'Az.RecoveryServicesBackup' +$rootModuleName = '' +if ($rootModuleName -eq "") +{ + $rootModuleName = $moduleName +} +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot "./$moduleName.psd1") +$modulePath = $modulePsd1.FullName + +# Load DLL to use build-time cmdlets +Import-Module -Name $modulePath +Import-Module -Name (Join-Path $PSScriptRoot "./bin/$moduleName.private.dll") +$instance = [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module]::Instance +# Module info is shared per profile +$moduleInfo = Get-Module -Name $moduleName +$parameterSetsInfo = Get-Module -Name "$moduleName.private" + +$buildinFunctions = @("Export-CmdletSurface", "Export-ExampleStub", "Export-FormatPs1xml", "Export-HelpMarkdown", "Export-ModelSurface", "Export-ProxyCmdlet", "Export-Psd1", "Export-TestStub", "Get-CommonParameter", "Get-ModuleGuid", "Get-ScriptCmdlet") + +function Test-FunctionSupported() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [string] + $FunctionName + ) + + If ($buildinfunctions.Contains($FunctionName)) { + return $false + } + + $cmdletName, $parameterSetName = $FunctionName.Split("_") + If ($parameterSetName.Contains("List") -or $parameterSetName.Contains("ViaIdentity")) { + return $false + } + If ($cmdletName.StartsWith("New") -or $cmdletName.StartsWith("Set") -or $cmdletName.StartsWith("Update")) { + return $false + } + + $parameterSetInfo = $parameterSetsInfo.ExportedCmdlets[$FunctionName] + foreach ($parameterInfo in $parameterSetInfo.Parameters.Values) + { + $category = (Get-ParameterAttribute -ParameterInfo $parameterInfo -AttributeName "CategoryAttribute").Categories + $invalideCategory = @('Query', 'Body') + if ($invalideCategory -contains $category) + { + return $false + } + } + + $customFiles = Get-ChildItem -Path custom -Filter "$cmdletName.*" + if ($customFiles.Length -ne 0) + { + return $false + } + + return $true +} + +function Get-MappedCmdletFromFunctionName() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [string] + $FunctionName + ) + + $cmdletName, $parameterSetName = $FunctionName.Split("_") + + return $cmdletName +} + +function Get-ParameterAttribute() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.ParameterMetadata] + $ParameterInfo, + [Parameter()] + [String] + $AttributeName + ) + return $ParameterInfo.Attributes | Where-Object { $_.TypeId.Name -eq $AttributeName } +} + +function Get-CmdletAttribute() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $CmdletInfo, + [Parameter()] + [String] + $AttributeName + ) + + return $CmdletInfo.ImplementingType.GetTypeInfo().GetCustomAttributes([System.object], $true) | Where-Object { $_.TypeId.Name -eq $AttributeName } +} + +function Get-CmdletDescription() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [String] + $CmdletName + ) + $helpInfo = Get-Help $CmdletName -Full + + $description = $helpInfo.Description.Text + if ($null -eq $description) + { + return "" + } + return $description +} + +# Test whether the parameter is from swagger http path +function Test-ParameterFromSwagger() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.ParameterMetadata] + $ParameterInfo + ) + $category = (Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "CategoryAttribute").Categories + $doNotExport = Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "DoNotExportAttribute" + if ($null -ne $doNotExport) + { + return $false + } + + $valideCategory = @('Path') + if ($valideCategory -contains $category) + { + return $true + } + return $false +} + +function New-ExampleForParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ } + $result = @() + foreach ($parameter in $parameters) + { + $category = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "CategoryAttribute").Categories + $sourceName = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "InfoAttribute").SerializedName + $name = $parameter.Name + $result += [ordered]@{ + name = "-$Name" + value = "[$category.$sourceName]" + } + } + + return $result +} + +function New-ParameterArrayInParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ } + $result = @() + foreach ($parameter in $parameters) + { + $isMandatory = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "ParameterAttribute").Mandatory + $parameterName = $parameter.Name + $parameterType = $parameter.ParameterType.ToString().Split('.')[1] + if ($parameter.SwitchParameter) + { + $parameterSignature = "-$parameterName" + } + else + { + $parameterSignature = "-$parameterName <$parameterType>" + } + if ($parameterName -eq "SubscriptionId") + { + $isMandatory = $false + } + if (-not $isMandatory) + { + $parameterSignature = "[$parameterSignature]" + } + $result += $parameterSignature + } + + return $result +} + +function New-MetadataForParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $httpAttribute = Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "HttpPathAttribute" + $httpPath = $httpAttribute.Path + $apiVersion = $httpAttribute.ApiVersion + $provider = [System.Text.RegularExpressions.Regex]::New("/providers/([\w+\.]+)/").Match($httpPath).Groups[1].Value + $resourcePath = "/" + $httpPath.Split("$provider/")[1] + $resourceType = [System.Text.RegularExpressions.Regex]::New("/([\w]+)/\{\w+\}").Matches($resourcePath) | ForEach-Object {$_.groups[1].Value} | Join-String -Separator "/" + $cmdletName = Get-MappedCmdletFromFunctionName $ParameterSetInfo.Name + $description = (Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "DescriptionAttribute").Description + [object[]]$example = New-ExampleForParameterSet $ParameterSetInfo + if ($Null -eq $example) + { + $example = @() + } + + [string[]]$signature = New-ParameterArrayInParameterSet $ParameterSetInfo + if ($Null -eq $signature) + { + $signature = @() + } + + return @{ + Path = $httpPath + Provider = $provider + ResourceType = $resourceType + ApiVersion = $apiVersion + CmdletName = $cmdletName + Description = $description + Example = $example + Signature = @{ + parameters = $signature + } + } +} + +function Merge-WithExistCmdletMetadata() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Collections.Specialized.OrderedDictionary] + $ExistedCmdletInfo, + [Parameter()] + [Hashtable] + $ParameterSetMetadata + ) + $ExistedCmdletInfo.help.parameterSets += $ParameterSetMetadata.Signature + $ExistedCmdletInfo.examples += [ordered]@{ + description = $ParameterSetMetadata.Description + parameters = $ParameterSetMetadata.Example + } + + return $ExistedCmdletInfo +} + +function New-MetadataForCmdlet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [Hashtable] + $ParameterSetMetadata + ) + $cmdletName = $ParameterSetMetadata.CmdletName + $description = Get-CmdletDescription $cmdletName + $result = [ordered]@{ + name = $cmdletName + description = $description + path = $ParameterSetMetadata.Path + help = [ordered]@{ + learnMore = [ordered]@{ + url = "https://learn.microsoft.com/powershell/module/$rootModuleName/$cmdletName".ToLower() + } + parameterSets = @() + } + examples = @() + } + $result = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $result -ParameterSetMetadata $ParameterSetMetadata + return $result +} + +$parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-functionSupported($_) } +$resourceTypes = @{} +foreach ($parameterSetName in $parameterSets) +{ + $cmdletInfo = $parameterSetsInfo.ExportedCommands[$parameterSetName] + $parameterSetMetadata = New-MetadataForParameterSet -ParameterSetInfo $cmdletInfo + $cmdletName = $parameterSetMetadata.CmdletName + if (-not ($moduleInfo.ExportedCommands.ContainsKey($cmdletName))) + { + continue + } + if ($resourceTypes.ContainsKey($parameterSetMetadata.ResourceType)) + { + $ExistedCmdletInfo = $resourceTypes[$parameterSetMetadata.ResourceType].commands | Where-Object { $_.name -eq $cmdletName } + if ($ExistedCmdletInfo) + { + $ExistedCmdletInfo = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $ExistedCmdletInfo -ParameterSetMetadata $parameterSetMetadata + } + else + { + $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata + $resourceTypes[$parameterSetMetadata.ResourceType].commands += $cmdletInfo + } + } + else + { + $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata + $resourceTypes[$parameterSetMetadata.ResourceType] = [ordered]@{ + resourceType = $parameterSetMetadata.ResourceType + apiVersion = $parameterSetMetadata.ApiVersion + learnMore = @{ + url = "https://learn.microsoft.com/powershell/module/$rootModuleName".ToLower() + } + commands = @($cmdletInfo) + provider = $parameterSetMetadata.Provider + } + } +} + +$UXFolder = 'UX' +if (Test-Path $UXFolder) +{ + Remove-Item -Path $UXFolder -Recurse +} +$null = New-Item -ItemType Directory -Path $UXFolder + +foreach ($resourceType in $resourceTypes.Keys) +{ + $resourceTypeFileName = $resourceType -replace "/", "-" + if ($resourceTypeFileName -eq "") + { + continue + } + $resourceTypeInfo = $resourceTypes[$resourceType] + $provider = $resourceTypeInfo.provider + $providerFolder = "$UXFolder/$provider" + if (-not (Test-Path $providerFolder)) + { + $null = New-Item -ItemType Directory -Path $providerFolder + } + $resourceTypeInfo.Remove("provider") + $resourceTypeInfo | ConvertTo-Json -Depth 10 | Out-File "$providerFolder/$resourceTypeFileName.json" +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/Module.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/Module.cs new file mode 100644 index 000000000000..c7403ccbbc6b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/Module.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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; + using SendAsyncStepDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + using PipelineChangeDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>; + using GetParameterDelegate = global::System.Func; + using ModuleLoadPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; + using ArgumentCompleterDelegate = global::System.Func; + using GetTelemetryIdDelegate = global::System.Func; + using TelemetryDelegate = global::System.Action; + using NewRequestPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; + using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>; + using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>; + using NextDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + using SanitizerDelegate = global::System.Action; + using GetTelemetryInfoDelegate = global::System.Func>; + + /// A class that contains the module-common code and data. + public partial class Module + { + /// The currently selected profile. + public string Profile = global::System.String.Empty; + + public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + + /// the ISendAsync pipeline instance + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline _pipeline; + + /// the ISendAsync pipeline instance (when proxy is enabled) + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline _pipelineWithProxy; + + public bool _useProxy = false; + + public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); + + /// Gets completion data for azure specific fields + public ArgumentCompleterDelegate ArgumentCompleter { get; set; } + + /// The instance of the Client API + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient ClientAPI { get; set; } + + /// A delegate that gets called for each signalled event + public EventListenerDelegate EventListener { get; set; } + + /// The delegate to call to get parameter data from a common module. + public GetParameterDelegate GetParameterValue { get; set; } + + /// The delegate to get the telemetry Id. + public GetTelemetryIdDelegate GetTelemetryId { get; set; } + + /// The delegate to get the telemetry info. + public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } + + /// Backing field for property. + private static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module _instance; + + /// the singleton of this module class + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module()); + + /// The Name of this module + public string Name => @"Az.RecoveryServicesBackup"; + + /// The delegate to call when this module is loaded (supporting a commmon module). + public ModuleLoadPipelineDelegate OnModuleLoad { get; set; } + + /// The delegate to call before each new request (supporting a commmon module). + public NewRequestPipelineDelegate OnNewRequest { get; set; } + + /// The name of the currently selected Azure profile + public global::System.String ProfileName { get; set; } + + /// The ResourceID for this module (azure arm). + public string ResourceId => @"Az.RecoveryServicesBackup"; + + /// The delegate to call in WriteObject to sanitize the output object. + public SanitizerDelegate SanitizeOutput { get; set; } + + /// The delegate for creating a telemetry. + public TelemetryDelegate Telemetry { get; set; } + + /// The from the cmdlet + /// The HttpPipeline for the request + + partial void AfterCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline pipeline); + + /// The from the cmdlet + /// The HttpPipeline for the request + + partial void BeforeCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline pipeline); + + partial void CustomInit(); + + /// Creates an instance of the HttpPipeline for each call. + /// The from the cmdlet + /// the cmdlet's correlation id. + /// the cmdlet's process record correlation id. + /// the cmdlet's parameterset name. + /// a dict for extensible parameters + /// An instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline for the remote call. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline CreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string processRecordId, string parameterSetName = null, global::System.Collections.Generic.IDictionary extensibleParameters = null) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline pipeline = null; + BeforeCreatePipeline(invocationInfo, ref pipeline); + pipeline = (pipeline ?? (_useProxy ? _pipelineWithProxy : _pipeline)).Clone(); + AfterCreatePipeline(invocationInfo, ref pipeline); + pipeline.Append(new Runtime.CmdInfoHandler(processRecordId, invocationInfo, parameterSetName).SendAsync); + OnNewRequest?.Invoke( invocationInfo, correlationId,processRecordId, (step)=> { pipeline.Prepend(step); } , (step)=> { pipeline.Append(step); } ); + return pipeline; + } + + /// Gets parameters from a common module. + /// The from the cmdlet + /// the cmdlet's correlation id. + /// The name of the parameter to get the value for. + /// + /// The parameter value from the common module. (Note: this should be type converted on the way back) + /// + public object GetParameter(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string parameterName) => GetParameterValue?.Invoke( ResourceId, Name, invocationInfo, correlationId,parameterName ); + + /// Initialization steps performed after the module is loaded. + public void Init() + { + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); + CustomInit(); + } + + /// Creates the module instance. + private Module() + { + // constructor + ClientAPI = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient(); + _handler.Proxy = _webProxy; + _pipeline = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient())); + _pipelineWithProxy = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient(_handler))); + } + + /// The HTTP Proxy to use. + /// The HTTP Proxy Credentials + /// True if the proxy should use default credentials + public void SetProxyConfiguration(global::System.Uri proxy, global::System.Management.Automation.PSCredential proxyCredential, bool proxyUseDefaultCredentials) + { + _useProxy = proxy != null; + if (proxy == null) + { + return; + } + // set the proxy configuration + _webProxy.Address = proxy; + _webProxy.BypassProxyOnLocal = false; + if (proxyUseDefaultCredentials) + { + _webProxy.Credentials = null; + _webProxy.UseDefaultCredentials = true; + } + else + { + _webProxy.UseDefaultCredentials = false; + _webProxy.Credentials = proxyCredential ?.GetNetworkCredential(); + } + } + + /// Called to dispatch events to the common module listener + /// The ID of the event + /// The cancellation token for the event + /// A delegate to get the detailed event data + /// The callback for the event dispatcher + /// The from the cmdlet + /// the cmdlet's parameterset name. + /// the cmdlet's correlation id. + /// the cmdlet's process record correlation id. + /// the exception that is being thrown (if available) + /// + /// A that will be complete when handling of the event is completed. + /// + public async global::System.Threading.Tasks.Task Signal(string id, global::System.Threading.CancellationToken token, global::System.Func getEventData, SignalDelegate signal, global::System.Management.Automation.InvocationInfo invocationInfo, string parameterSetName, string correlationId, string processRecordId, global::System.Exception exception) + { + using( NoSynchronizationContext ) + { + await EventListener?.Invoke(id,token,getEventData, signal, invocationInfo, parameterSetName, correlationId,processRecordId,exception); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Any.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Any.PowerShell.cs new file mode 100644 index 000000000000..fff4ce7ed594 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Any.PowerShell.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 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Any object + [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] + public partial class Any + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Any(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Any(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Any(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Any(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Any object + [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] + public partial interface IAny + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Any.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Any.TypeConverter.cs new file mode 100644 index 000000000000..6552674a5477 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Any.TypeConverter.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 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AnyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Any.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Any.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Any.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Any.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Any.cs new file mode 100644 index 000000000000..201d8b7f51f3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/api/Models/Any.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Any.json.cs new file mode 100644 index 000000000000..c09198e2b878 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Any.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 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.DefaultTag/generated/api/Models/Api10/ErrorAdditionalInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api10/ErrorAdditionalInfo.PowerShell.cs new file mode 100644 index 000000000000..3e5830129539 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api10/ErrorAdditionalInfo.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// The resource management error additional info. + [System.ComponentModel.TypeConverter(typeof(ErrorAdditionalInfoTypeConverter))] + public partial class ErrorAdditionalInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorAdditionalInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorAdditionalInfo(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorAdditionalInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Info")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.AnyTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Info")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.AnyTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The resource management error additional info. + [System.ComponentModel.TypeConverter(typeof(ErrorAdditionalInfoTypeConverter))] + public partial interface IErrorAdditionalInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api10/ErrorAdditionalInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api10/ErrorAdditionalInfo.TypeConverter.cs new file mode 100644 index 000000000000..7f9440192e03 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api10/ErrorAdditionalInfo.TypeConverter.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.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorAdditionalInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorAdditionalInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorAdditionalInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorAdditionalInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api10/ErrorAdditionalInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api10/ErrorAdditionalInfo.cs new file mode 100644 index 000000000000..c3319b37105b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/api/Models/Api10/ErrorAdditionalInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api10/ErrorAdditionalInfo.json.cs new file mode 100644 index 000000000000..72b81d5c97df --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api10/ErrorAdditionalInfo.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.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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.DefaultTag/generated/api/Models/Api20241115/AadProperties.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadProperties.PowerShell.cs new file mode 100644 index 000000000000..4f58937a65f5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadProperties.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(AadPropertiesTypeConverter))] + public partial class AadProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AadProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServicePrincipalClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).ServicePrincipalClientId = (string) content.GetValueForProperty("ServicePrincipalClientId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).ServicePrincipalClientId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Authority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).Authority, global::System.Convert.ToString); + } + if (content.Contains("Audience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).Audience = (string) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).Audience, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).ServicePrincipalObjectId = (string) content.GetValueForProperty("ServicePrincipalObjectId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).ServicePrincipalObjectId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AadProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServicePrincipalClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).ServicePrincipalClientId = (string) content.GetValueForProperty("ServicePrincipalClientId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).ServicePrincipalClientId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Authority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).Authority, global::System.Convert.ToString); + } + if (content.Contains("Audience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).Audience = (string) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).Audience, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).ServicePrincipalObjectId = (string) content.GetValueForProperty("ServicePrincipalObjectId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)this).ServicePrincipalObjectId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AadProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AadProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(AadPropertiesTypeConverter))] + public partial interface IAadProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadProperties.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadProperties.TypeConverter.cs new file mode 100644 index 000000000000..8474ca315893 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadProperties.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AadPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AadProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AadProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AadProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadProperties.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadProperties.cs new file mode 100644 index 000000000000..7bac6cfc4753 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadProperties.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class AadProperties : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadProperties, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal + { + + /// Backing field for property. + private string _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 _authority; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string Authority { get => this._authority; set => this._authority = value; } + + /// Backing field for property. + private string _servicePrincipalClientId; + + [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 _servicePrincipalObjectId; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ServicePrincipalObjectId { get => this._servicePrincipalObjectId; set => this._servicePrincipalObjectId = value; } + + /// Backing field for property. + private string _tenantId; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; set => this._tenantId = value; } + + /// Creates an new instance. + public AadProperties() + { + + } + } + public partial interface IAadProperties : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"audience", + PossibleTypes = new [] { typeof(string) })] + string Audience { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"authority", + PossibleTypes = new [] { typeof(string) })] + string Authority { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"servicePrincipalClientId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalClientId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"servicePrincipalObjectId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalObjectId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + + } + internal partial interface IAadPropertiesInternal + + { + string Audience { get; set; } + + string Authority { get; set; } + + string ServicePrincipalClientId { get; set; } + + string ServicePrincipalObjectId { get; set; } + + string TenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadProperties.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadProperties.json.cs new file mode 100644 index 000000000000..d63963100fc1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadProperties.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class AadProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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 AadProperties(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_servicePrincipalClientId = If( json?.PropertyT("servicePrincipalClientId"), out var __jsonServicePrincipalClientId) ? (string)__jsonServicePrincipalClientId : (string)ServicePrincipalClientId;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + {_authority = If( json?.PropertyT("authority"), out var __jsonAuthority) ? (string)__jsonAuthority : (string)Authority;} + {_audience = If( json?.PropertyT("audience"), out var __jsonAudience) ? (string)__jsonAudience : (string)Audience;} + {_servicePrincipalObjectId = If( json?.PropertyT("servicePrincipalObjectId"), out var __jsonServicePrincipalObjectId) ? (string)__jsonServicePrincipalObjectId : (string)ServicePrincipalObjectId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AadProperties(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._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._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + AddIf( null != (((object)this._authority)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._authority.ToString()) : null, "authority" ,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 ); + AddIf( null != (((object)this._servicePrincipalObjectId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._servicePrincipalObjectId.ToString()) : null, "servicePrincipalObjectId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadPropertiesResource.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadPropertiesResource.PowerShell.cs new file mode 100644 index 000000000000..83c12bef227b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadPropertiesResource.PowerShell.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(AadPropertiesResourceTypeConverter))] + public partial class AadPropertiesResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AadPropertiesResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AadPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).ServicePrincipalClientId = (string) content.GetValueForProperty("ServicePrincipalClientId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).ServicePrincipalClientId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Authority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).Authority, global::System.Convert.ToString); + } + if (content.Contains("Audience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).Audience = (string) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).Audience, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).ServicePrincipalObjectId = (string) content.GetValueForProperty("ServicePrincipalObjectId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).ServicePrincipalObjectId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AadPropertiesResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AadPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).ServicePrincipalClientId = (string) content.GetValueForProperty("ServicePrincipalClientId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).ServicePrincipalClientId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Authority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).Authority, global::System.Convert.ToString); + } + if (content.Contains("Audience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).Audience = (string) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).Audience, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).ServicePrincipalObjectId = (string) content.GetValueForProperty("ServicePrincipalObjectId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal)this).ServicePrincipalObjectId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AadPropertiesResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AadPropertiesResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(AadPropertiesResourceTypeConverter))] + public partial interface IAadPropertiesResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadPropertiesResource.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadPropertiesResource.TypeConverter.cs new file mode 100644 index 000000000000..f67f5359d774 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadPropertiesResource.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AadPropertiesResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AadPropertiesResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AadPropertiesResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AadPropertiesResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadPropertiesResource.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadPropertiesResource.cs new file mode 100644 index 000000000000..2db059cd56a9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadPropertiesResource.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class AadPropertiesResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.Resource(); + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string Audience { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)Property).Audience; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)Property).Audience = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string Authority { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)Property).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)Property).Authority = 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.Api20241115.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadProperties Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AadProperties()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadProperties _property; + + /// AADPropertiesResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AadProperties()); set => this._property = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ServicePrincipalClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)Property).ServicePrincipalClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)Property).ServicePrincipalClientId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ServicePrincipalObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)Property).ServicePrincipalObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)Property).ServicePrincipalObjectId = value ?? null; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)Property).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesInternal)Property).TenantId = value ?? null; } + + /// + /// 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.Api20241115.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public AadPropertiesResource() + { + + } + + /// 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 IAadPropertiesResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"audience", + PossibleTypes = new [] { typeof(string) })] + string Audience { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"authority", + PossibleTypes = new [] { typeof(string) })] + string Authority { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"servicePrincipalClientId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalClientId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"servicePrincipalObjectId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalObjectId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + + } + internal partial interface IAadPropertiesResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal + { + string Audience { get; set; } + + string Authority { get; set; } + /// AADPropertiesResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadProperties Property { get; set; } + + string ServicePrincipalClientId { get; set; } + + string ServicePrincipalObjectId { get; set; } + + string TenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadPropertiesResource.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadPropertiesResource.json.cs new file mode 100644 index 000000000000..d92abcf4ce9b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AadPropertiesResource.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class AadPropertiesResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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 AadPropertiesResource(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.Api20241115.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AadProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AadPropertiesResource(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.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRecoveryPoint.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRecoveryPoint.PowerShell.cs new file mode 100644 index 000000000000..227ca364e083 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRecoveryPoint.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure File Share workload specific backup copy. + [System.ComponentModel.TypeConverter(typeof(AzureFileShareRecoveryPointTypeConverter))] + public partial class AzureFileShareRecoveryPoint + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureFileShareRecoveryPoint(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointType = (string) content.GetValueForProperty("RecoveryPointType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointType, global::System.Convert.ToString); + } + if (content.Contains("CrossRegionRestoreState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).CrossRegionRestoreState = (string) content.GetValueForProperty("CrossRegionRestoreState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).CrossRegionRestoreState, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointTime = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FileShareSnapshotUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).FileShareSnapshotUri = (string) content.GetValueForProperty("FileShareSnapshotUri",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).FileShareSnapshotUri, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointSizeInGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointSizeInGb = (int?) content.GetValueForProperty("RecoveryPointSizeInGb",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointSizeInGb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureFileShareRecoveryPoint(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointType = (string) content.GetValueForProperty("RecoveryPointType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointType, global::System.Convert.ToString); + } + if (content.Contains("CrossRegionRestoreState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).CrossRegionRestoreState = (string) content.GetValueForProperty("CrossRegionRestoreState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).CrossRegionRestoreState, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointTime = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FileShareSnapshotUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).FileShareSnapshotUri = (string) content.GetValueForProperty("FileShareSnapshotUri",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).FileShareSnapshotUri, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointSizeInGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointSizeInGb = (int?) content.GetValueForProperty("RecoveryPointSizeInGb",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointSizeInGb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureFileShareRecoveryPoint(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureFileShareRecoveryPoint(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure File Share workload specific backup copy. + [System.ComponentModel.TypeConverter(typeof(AzureFileShareRecoveryPointTypeConverter))] + public partial interface IAzureFileShareRecoveryPoint + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRecoveryPoint.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRecoveryPoint.TypeConverter.cs new file mode 100644 index 000000000000..9bbb2bfdec45 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRecoveryPoint.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureFileShareRecoveryPointTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPoint ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPoint).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureFileShareRecoveryPoint.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureFileShareRecoveryPoint.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureFileShareRecoveryPoint.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRecoveryPoint.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRecoveryPoint.cs new file mode 100644 index 000000000000..6b3af71909ac --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRecoveryPoint.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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.Api20241115.IAzureFileShareRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint __recoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPoint(); + + /// Backing field for property. + private string _crossRegionRestoreState; + + /// Denotes whether the Recovery point can be restored to secondary region + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string CrossRegionRestoreState { get => this._crossRegionRestoreState; set => this._crossRegionRestoreState = value; } + + /// 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; } + + /// Internal Acessors for FileShareSnapshotUri + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal.FileShareSnapshotUri { get => this._fileShareSnapshotUri; set { {_fileShareSnapshotUri = value;} } } + + /// Internal Acessors for RecoveryPointProperty + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal.RecoveryPointProperty { get => (this._recoveryPointProperty = this._recoveryPointProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointProperties()); set { {_recoveryPointProperty = value;} } } + + /// Internal Acessors for RecoveryPointSizeInGb + int? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal.RecoveryPointSizeInGb { get => this._recoveryPointSizeInGb; set { {_recoveryPointSizeInGb = value;} } } + + /// Internal Acessors for RecoveryPointTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal.RecoveryPointTime { get => this._recoveryPointTime; set { {_recoveryPointTime = value;} } } + + /// Internal Acessors for RecoveryPointType + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPointInternal.RecoveryPointType { get => this._recoveryPointType; set { {_recoveryPointType = 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.Api20241115.IRecoveryPointInternal)__recoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)__recoveryPoint).ObjectType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties _recoveryPointProperty; + + /// Properties of Recovery Point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties RecoveryPointProperty { get => (this._recoveryPointProperty = this._recoveryPointProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointProperties()); set => this._recoveryPointProperty = value; } + + /// Expiry time of Recovery Point in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RecoveryPointPropertyExpiryTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).ExpiryTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).ExpiryTime = value ?? null; } + + /// Bool to indicate whether RP is in soft delete state or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? RecoveryPointPropertyIsSoftDeleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).IsSoftDeleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).IsSoftDeleted = value ?? default(bool); } + + /// Rule name tagged on Recovery Point that governs life cycle + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RecoveryPointPropertyRuleName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).RuleName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).RuleName = value ?? null; } + + /// 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; } + + /// 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; } + + /// 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; } + + /// 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.Api20241115.IRecoveryPoint + { + /// Denotes whether the Recovery point can be restored to secondary region + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Denotes whether the Recovery point can be restored to secondary region", + SerializedName = @"crossRegionRestoreState", + PossibleTypes = new [] { typeof(string) })] + string CrossRegionRestoreState { get; set; } + /// Contains Url to the snapshot of fileshare, if applicable + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Contains Url to the snapshot of fileshare, if applicable", + SerializedName = @"fileShareSnapshotUri", + PossibleTypes = new [] { typeof(string) })] + string FileShareSnapshotUri { get; } + /// Expiry time of Recovery Point in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiry time of Recovery Point in UTC.", + SerializedName = @"expiryTime", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointPropertyExpiryTime { get; set; } + /// Bool to indicate whether RP is in soft delete state or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Bool to indicate whether RP is in soft delete state or not", + SerializedName = @"isSoftDeleted", + PossibleTypes = new [] { typeof(bool) })] + bool? RecoveryPointPropertyIsSoftDeleted { get; set; } + /// Rule name tagged on Recovery Point that governs life cycle + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rule name tagged on Recovery Point that governs life cycle", + SerializedName = @"ruleName", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointPropertyRuleName { get; set; } + /// Contains recovery point size + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Contains recovery point size", + SerializedName = @"recoveryPointSizeInGB", + PossibleTypes = new [] { typeof(int) })] + int? RecoveryPointSizeInGb { get; } + /// Time at which this backup copy was created. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Time at which this backup copy was created.", + SerializedName = @"recoveryPointTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RecoveryPointTime { get; } + /// + /// 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 = true, + 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; } + + } + /// Azure File Share workload specific backup copy. + internal partial interface IAzureFileShareRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal + { + /// Denotes whether the Recovery point can be restored to secondary region + string CrossRegionRestoreState { get; set; } + /// Contains Url to the snapshot of fileshare, if applicable + string FileShareSnapshotUri { get; set; } + /// Properties of Recovery Point + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties RecoveryPointProperty { get; set; } + /// Expiry time of Recovery Point in UTC. + string RecoveryPointPropertyExpiryTime { get; set; } + /// Bool to indicate whether RP is in soft delete state or not + bool? RecoveryPointPropertyIsSoftDeleted { get; set; } + /// Rule name tagged on Recovery Point that governs life cycle + string RecoveryPointPropertyRuleName { 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.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRecoveryPoint.json.cs new file mode 100644 index 000000000000..9d589b3c7665 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRecoveryPoint.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.RecoveryPoint(json); + {_recoveryPointProperty = If( json?.PropertyT("recoveryPointProperties"), out var __jsonRecoveryPointProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointProperties.FromJson(__jsonRecoveryPointProperties) : RecoveryPointProperty;} + {_recoveryPointType = If( json?.PropertyT("recoveryPointType"), out var __jsonRecoveryPointType) ? (string)__jsonRecoveryPointType : (string)RecoveryPointType;} + {_crossRegionRestoreState = If( json?.PropertyT("crossRegionRestoreState"), out var __jsonCrossRegionRestoreState) ? (string)__jsonCrossRegionRestoreState : (string)CrossRegionRestoreState;} + {_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.Api20241115.IAzureFileShareRecoveryPoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 != this._recoveryPointProperty ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._recoveryPointProperty.ToJson(null,serializationMode) : null, "recoveryPointProperties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + 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 != (((object)this._crossRegionRestoreState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._crossRegionRestoreState.ToString()) : null, "crossRegionRestoreState" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + 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 ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + 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 ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + 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.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRestoreRequest.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRestoreRequest.PowerShell.cs new file mode 100644 index 000000000000..68bfd347e619 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRestoreRequest.PowerShell.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// AzureFileShare Restore Request + [System.ComponentModel.TypeConverter(typeof(AzureFileShareRestoreRequestTypeConverter))] + public partial class AzureFileShareRestoreRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureFileShareRestoreRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).TargetDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfo) content.GetValueForProperty("TargetDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).TargetDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetAfsRestoreInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("CopyOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).CopyOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions?) content.GetValueForProperty("CopyOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).CopyOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions.CreateFrom); + } + if (content.Contains("RestoreRequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).RestoreRequestType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType?) content.GetValueForProperty("RestoreRequestType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).RestoreRequestType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType.CreateFrom); + } + if (content.Contains("RestoreFileSpec")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).RestoreFileSpec = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecs[]) content.GetValueForProperty("RestoreFileSpec",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).RestoreFileSpec, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RestoreFileSpecsTypeConverter.ConvertFrom)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetDetailName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).TargetDetailName = (string) content.GetValueForProperty("TargetDetailName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).TargetDetailName, global::System.Convert.ToString); + } + if (content.Contains("TargetDetailTargetResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).TargetDetailTargetResourceId = (string) content.GetValueForProperty("TargetDetailTargetResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).TargetDetailTargetResourceId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureFileShareRestoreRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).TargetDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfo) content.GetValueForProperty("TargetDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).TargetDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetAfsRestoreInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("CopyOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).CopyOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions?) content.GetValueForProperty("CopyOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).CopyOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptions.CreateFrom); + } + if (content.Contains("RestoreRequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).RestoreRequestType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType?) content.GetValueForProperty("RestoreRequestType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).RestoreRequestType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestType.CreateFrom); + } + if (content.Contains("RestoreFileSpec")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).RestoreFileSpec = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecs[]) content.GetValueForProperty("RestoreFileSpec",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).RestoreFileSpec, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RestoreFileSpecsTypeConverter.ConvertFrom)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetDetailName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).TargetDetailName = (string) content.GetValueForProperty("TargetDetailName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).TargetDetailName, global::System.Convert.ToString); + } + if (content.Contains("TargetDetailTargetResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).TargetDetailTargetResourceId = (string) content.GetValueForProperty("TargetDetailTargetResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal)this).TargetDetailTargetResourceId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureFileShareRestoreRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureFileShareRestoreRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// AzureFileShare Restore Request + [System.ComponentModel.TypeConverter(typeof(AzureFileShareRestoreRequestTypeConverter))] + public partial interface IAzureFileShareRestoreRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRestoreRequest.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRestoreRequest.TypeConverter.cs new file mode 100644 index 000000000000..efe582fef63e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRestoreRequest.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureFileShareRestoreRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureFileShareRestoreRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureFileShareRestoreRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureFileShareRestoreRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRestoreRequest.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRestoreRequest.cs new file mode 100644 index 000000000000..5ba44c65381b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureFileShare Restore Request + public partial class AzureFileShareRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest __restoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ITargetAfsRestoreInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequestInternal.TargetDetail { get => (this._targetDetail = this._targetDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRestoreRequestInternal)__restoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.ITargetAfsRestoreInfo TargetDetail { get => (this._targetDetail = this._targetDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ITargetAfsRestoreInfoInternal)TargetDetail).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ITargetAfsRestoreInfoInternal)TargetDetail).TargetResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IRestoreFileSpecs) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRestoreRequest.json.cs new file mode 100644 index 000000000000..75d57fda737a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileShareRestoreRequest.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.RestoreRequest(json); + {_targetDetail = If( json?.PropertyT("targetDetails"), out var __jsonTargetDetails) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRestoreFileSpecs) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RestoreFileSpecs.FromJson(__u) )) ))() : null : RestoreFileSpec;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileShareRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItem.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItem.PowerShell.cs new file mode 100644 index 000000000000..b00e3566fade --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItem.PowerShell.cs @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure File Share workload-specific backup item. + [System.ComponentModel.TypeConverter(typeof(AzureFileshareProtectedItemTypeConverter))] + public partial class AzureFileshareProtectedItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureFileshareProtectedItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureFileshareProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("HealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).HealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus?) content.GetValueForProperty("HealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).HealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus.CreateFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).LastBackupStatus = (string) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).LastBackupStatus, global::System.Convert.ToString); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureFileshareProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoPolicyState = (string) content.GetValueForProperty("ExtendedInfoPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoPolicyState, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoResourceState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoResourceState = (string) content.GetValueForProperty("ExtendedInfoResourceState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoResourceState, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoResourceStateSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoResourceStateSyncTime = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoResourceStateSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoResourceStateSyncTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureFileshareProtectedItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureFileshareProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("HealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).HealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus?) content.GetValueForProperty("HealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).HealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus.CreateFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).LastBackupStatus = (string) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).LastBackupStatus, global::System.Convert.ToString); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureFileshareProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoPolicyState = (string) content.GetValueForProperty("ExtendedInfoPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoPolicyState, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoResourceState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoResourceState = (string) content.GetValueForProperty("ExtendedInfoResourceState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoResourceState, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoResourceStateSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoResourceStateSyncTime = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoResourceStateSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal)this).ExtendedInfoResourceStateSyncTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureFileshareProtectedItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureFileshareProtectedItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure File Share workload-specific backup item. + [System.ComponentModel.TypeConverter(typeof(AzureFileshareProtectedItemTypeConverter))] + public partial interface IAzureFileshareProtectedItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItem.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItem.TypeConverter.cs new file mode 100644 index 000000000000..a2e7f66aafcf --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItem.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureFileshareProtectedItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureFileshareProtectedItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureFileshareProtectedItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureFileshareProtectedItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItem.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItem.cs new file mode 100644 index 000000000000..3be7aeac3a32 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItem.cs @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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.Api20241115.IAzureFileshareProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureFileshareProtectedItemExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).PolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus? _healthStatus; + + /// backups running status for this backup 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 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.Api20241115.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureFileshareProtectedItemKpisHealths KpisHealth { get => (this._kpisHealth = this._kpisHealth ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureFileshareProtectedItemExtendedInfo()); set { {_extendedInfo = value;} } } + + /// Internal Acessors for ExtendedInfoResourceState + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal.ExtendedInfoResourceState { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).ResourceState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).ResourceState = value; } + + /// Internal Acessors for ExtendedInfoResourceStateSyncTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemInternal.ExtendedInfoResourceStateSyncTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)ExtendedInfo).ResourceStateSyncTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).PolicyId = 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.Api20241115.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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; } + /// backups running status for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"backups running status for this backup 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.Api20241115.IAzureFileshareProtectedItemKpisHealths) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal + { + /// Additional information with this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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; } + /// backups running status for this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus? HealthStatus { get; set; } + /// Health details of different KPIs + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItem.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItem.json.cs new file mode 100644 index 000000000000..4e8e51960631 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItem.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.ProtectedItem(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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;} + {_healthStatus = If( json?.PropertyT("healthStatus"), out var __jsonHealthStatus) ? (string)__jsonHealthStatus : (string)HealthStatus;} + {_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.Api20241115.AzureFileshareProtectedItemKpisHealths.FromJson(__jsonKpisHealths) : KpisHealth;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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._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._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.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..59e7fcbb1751 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemExtendedInfo.PowerShell.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Additional information about Azure File Share backup item. + [System.ComponentModel.TypeConverter(typeof(AzureFileshareProtectedItemExtendedInfoTypeConverter))] + public partial class AzureFileshareProtectedItemExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureFileshareProtectedItemExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).RecoveryPointCount = (int?) content.GetValueForProperty("RecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).RecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).PolicyState = (string) content.GetValueForProperty("PolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).PolicyState, global::System.Convert.ToString); + } + if (content.Contains("ResourceState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).ResourceState = (string) content.GetValueForProperty("ResourceState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).ResourceState, global::System.Convert.ToString); + } + if (content.Contains("ResourceStateSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).ResourceStateSyncTime = (global::System.DateTime?) content.GetValueForProperty("ResourceStateSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).ResourceStateSyncTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureFileshareProtectedItemExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).RecoveryPointCount = (int?) content.GetValueForProperty("RecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).RecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).PolicyState = (string) content.GetValueForProperty("PolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).PolicyState, global::System.Convert.ToString); + } + if (content.Contains("ResourceState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).ResourceState = (string) content.GetValueForProperty("ResourceState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).ResourceState, global::System.Convert.ToString); + } + if (content.Contains("ResourceStateSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).ResourceStateSyncTime = (global::System.DateTime?) content.GetValueForProperty("ResourceStateSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal)this).ResourceStateSyncTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureFileshareProtectedItemExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureFileshareProtectedItemExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Additional information about Azure File Share backup item. + [System.ComponentModel.TypeConverter(typeof(AzureFileshareProtectedItemExtendedInfoTypeConverter))] + public partial interface IAzureFileshareProtectedItemExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..75d1a40be0f0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemExtendedInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureFileshareProtectedItemExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureFileshareProtectedItemExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureFileshareProtectedItemExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureFileshareProtectedItemExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..418cd11b4388 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IAzureFileshareProtectedItemExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal + { + + /// Internal Acessors for ResourceState + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfoInternal.ResourceState { get => this._resourceState; set { {_resourceState = value;} } } + + /// Internal Acessors for ResourceStateSyncTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemExtendedInfo.json.cs new file mode 100644 index 000000000000..64aff0099a75 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureFileshareProtectedItemExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemKpisHealths.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemKpisHealths.PowerShell.cs new file mode 100644 index 000000000000..097120509bfd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemKpisHealths.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Health details of different KPIs + [System.ComponentModel.TypeConverter(typeof(AzureFileshareProtectedItemKpisHealthsTypeConverter))] + public partial class AzureFileshareProtectedItemKpisHealths + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureFileshareProtectedItemKpisHealths(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureFileshareProtectedItemKpisHealths(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemKpisHealths DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureFileshareProtectedItemKpisHealths(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemKpisHealths DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureFileshareProtectedItemKpisHealths(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemKpisHealths FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Health details of different KPIs + [System.ComponentModel.TypeConverter(typeof(AzureFileshareProtectedItemKpisHealthsTypeConverter))] + public partial interface IAzureFileshareProtectedItemKpisHealths + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemKpisHealths.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemKpisHealths.TypeConverter.cs new file mode 100644 index 000000000000..615837420d12 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemKpisHealths.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureFileshareProtectedItemKpisHealthsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemKpisHealths ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemKpisHealths).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureFileshareProtectedItemKpisHealths.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureFileshareProtectedItemKpisHealths.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureFileshareProtectedItemKpisHealths.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemKpisHealths.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemKpisHealths.cs new file mode 100644 index 000000000000..98077426a61d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Health details of different KPIs + public partial class AzureFileshareProtectedItemKpisHealths : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemKpisHealths, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemKpisHealths.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemKpisHealths.dictionary.cs new file mode 100644 index 000000000000..a8725e52347f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.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.Api20241115.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.Api20241115.IKpiResourceHealthDetails value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureFileshareProtectedItemKpisHealths source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemKpisHealths.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemKpisHealths.json.cs new file mode 100644 index 000000000000..5a38eb9993f8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureFileshareProtectedItemKpisHealths.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.KpiResourceHealthDetails.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemKpisHealths. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureFileshareProtectedItemKpisHealths. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSClassicComputeVmprotectedItem.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSClassicComputeVmprotectedItem.PowerShell.cs new file mode 100644 index 000000000000..a5bc61f1c2bb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSClassicComputeVmprotectedItem.PowerShell.cs @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// IaaS VM workload-specific backup item representing the Classic Compute VM. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSClassicComputeVmprotectedItemTypeConverter))] + public partial class AzureIaaSClassicComputeVmprotectedItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureIaaSClassicComputeVmprotectedItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyInconsistent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoPolicyInconsistent = (bool?) content.GetValueForProperty("ExtendedInfoPolicyInconsistent",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoPolicyInconsistent, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedPropertyDiskExclusionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedPropertyDiskExclusionProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties) content.GetValueForProperty("ExtendedPropertyDiskExclusionProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedPropertyDiskExclusionProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskExclusionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DiskExclusionPropertyDiskLunList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyDiskLunList = (int[]) content.GetValueForProperty("DiskExclusionPropertyDiskLunList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyDiskLunList, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("DiskExclusionPropertyIsInclusionList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyIsInclusionList = (bool?) content.GetValueForProperty("DiskExclusionPropertyIsInclusionList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyIsInclusionList, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedProperties) content.GetValueForProperty("ExtendedProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ExtendedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).VirtualMachineId = (string) content.GetValueForProperty("VirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).VirtualMachineId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("HealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus?) content.GetValueForProperty("HealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus.CreateFrom); + } + if (content.Contains("HealthDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails[]) content.GetValueForProperty("HealthDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceHealthDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupStatus = (string) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupStatus, global::System.Convert.ToString); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedItemDataId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectedItemDataId = (string) content.GetValueForProperty("ProtectedItemDataId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectedItemDataId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureIaaSClassicComputeVmprotectedItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyInconsistent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoPolicyInconsistent = (bool?) content.GetValueForProperty("ExtendedInfoPolicyInconsistent",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoPolicyInconsistent, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedPropertyDiskExclusionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedPropertyDiskExclusionProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties) content.GetValueForProperty("ExtendedPropertyDiskExclusionProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedPropertyDiskExclusionProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskExclusionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DiskExclusionPropertyDiskLunList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyDiskLunList = (int[]) content.GetValueForProperty("DiskExclusionPropertyDiskLunList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyDiskLunList, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("DiskExclusionPropertyIsInclusionList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyIsInclusionList = (bool?) content.GetValueForProperty("DiskExclusionPropertyIsInclusionList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyIsInclusionList, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedProperties) content.GetValueForProperty("ExtendedProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ExtendedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).VirtualMachineId = (string) content.GetValueForProperty("VirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).VirtualMachineId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("HealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus?) content.GetValueForProperty("HealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus.CreateFrom); + } + if (content.Contains("HealthDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails[]) content.GetValueForProperty("HealthDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceHealthDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupStatus = (string) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupStatus, global::System.Convert.ToString); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedItemDataId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectedItemDataId = (string) content.GetValueForProperty("ProtectedItemDataId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectedItemDataId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSClassicComputeVmprotectedItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureIaaSClassicComputeVmprotectedItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSClassicComputeVmprotectedItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureIaaSClassicComputeVmprotectedItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSClassicComputeVmprotectedItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// IaaS VM workload-specific backup item representing the Classic Compute VM. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSClassicComputeVmprotectedItemTypeConverter))] + public partial interface IAzureIaaSClassicComputeVmprotectedItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSClassicComputeVmprotectedItem.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSClassicComputeVmprotectedItem.TypeConverter.cs new file mode 100644 index 000000000000..cd511ec37da1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSClassicComputeVmprotectedItem.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureIaaSClassicComputeVmprotectedItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSClassicComputeVmprotectedItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSClassicComputeVmprotectedItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureIaaSClassicComputeVmprotectedItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureIaaSClassicComputeVmprotectedItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureIaaSClassicComputeVmprotectedItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSClassicComputeVmprotectedItem.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSClassicComputeVmprotectedItem.cs new file mode 100644 index 000000000000..6623edb0abd0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSClassicComputeVmprotectedItem.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.Api20241115 +{ + 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.Api20241115.IAzureIaaSClassicComputeVmprotectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSClassicComputeVmprotectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItem __azureIaaSvmProtectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).DiskExclusionPropertyDiskLunList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).DiskExclusionPropertyIsInclusionList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfo = value ?? null /* model class */; } + + /// The oldest backup copy available for this backup item. + [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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPoint = 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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoPolicyInconsistent; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoRecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IExtendedProperties ExtendedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDiskExclusionProperties ExtendedPropertyDiskExclusionProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedPropertyDiskExclusionProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedPropertyDiskExclusionProperty = value ?? null /* model class */; } + + /// 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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceHealthDetails[] HealthDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).HealthDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).HealthStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus)""); } + + /// 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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemKpisHealths KpisHealth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).KpisHealth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).LastBackupStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).LastBackupTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).PolicyId = 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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectedItemDataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).VirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItem + { + + } + /// IaaS VM workload-specific backup item representing the Classic Compute VM. + internal partial interface IAzureIaaSClassicComputeVmprotectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSClassicComputeVmprotectedItem.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSClassicComputeVmprotectedItem.json.cs new file mode 100644 index 000000000000..36800fc0a177 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSClassicComputeVmprotectedItem.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.AzureIaaSvmProtectedItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSClassicComputeVmprotectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSClassicComputeVmprotectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSComputeVmprotectedItem.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSComputeVmprotectedItem.PowerShell.cs new file mode 100644 index 000000000000..e00d963a724f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSComputeVmprotectedItem.PowerShell.cs @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + /// + [System.ComponentModel.TypeConverter(typeof(AzureIaaSComputeVmprotectedItemTypeConverter))] + public partial class AzureIaaSComputeVmprotectedItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureIaaSComputeVmprotectedItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyInconsistent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoPolicyInconsistent = (bool?) content.GetValueForProperty("ExtendedInfoPolicyInconsistent",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoPolicyInconsistent, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedPropertyDiskExclusionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedPropertyDiskExclusionProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties) content.GetValueForProperty("ExtendedPropertyDiskExclusionProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedPropertyDiskExclusionProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskExclusionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DiskExclusionPropertyDiskLunList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyDiskLunList = (int[]) content.GetValueForProperty("DiskExclusionPropertyDiskLunList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyDiskLunList, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("DiskExclusionPropertyIsInclusionList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyIsInclusionList = (bool?) content.GetValueForProperty("DiskExclusionPropertyIsInclusionList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyIsInclusionList, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedProperties) content.GetValueForProperty("ExtendedProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ExtendedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).VirtualMachineId = (string) content.GetValueForProperty("VirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).VirtualMachineId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("HealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus?) content.GetValueForProperty("HealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus.CreateFrom); + } + if (content.Contains("HealthDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails[]) content.GetValueForProperty("HealthDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceHealthDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupStatus = (string) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupStatus, global::System.Convert.ToString); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedItemDataId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectedItemDataId = (string) content.GetValueForProperty("ProtectedItemDataId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectedItemDataId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureIaaSComputeVmprotectedItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyInconsistent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoPolicyInconsistent = (bool?) content.GetValueForProperty("ExtendedInfoPolicyInconsistent",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoPolicyInconsistent, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedPropertyDiskExclusionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedPropertyDiskExclusionProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties) content.GetValueForProperty("ExtendedPropertyDiskExclusionProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedPropertyDiskExclusionProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskExclusionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DiskExclusionPropertyDiskLunList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyDiskLunList = (int[]) content.GetValueForProperty("DiskExclusionPropertyDiskLunList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyDiskLunList, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("DiskExclusionPropertyIsInclusionList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyIsInclusionList = (bool?) content.GetValueForProperty("DiskExclusionPropertyIsInclusionList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyIsInclusionList, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedProperties) content.GetValueForProperty("ExtendedProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ExtendedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).VirtualMachineId = (string) content.GetValueForProperty("VirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).VirtualMachineId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("HealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus?) content.GetValueForProperty("HealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus.CreateFrom); + } + if (content.Contains("HealthDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails[]) content.GetValueForProperty("HealthDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceHealthDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupStatus = (string) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupStatus, global::System.Convert.ToString); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedItemDataId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectedItemDataId = (string) content.GetValueForProperty("ProtectedItemDataId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectedItemDataId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSComputeVmprotectedItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureIaaSComputeVmprotectedItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSComputeVmprotectedItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureIaaSComputeVmprotectedItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSComputeVmprotectedItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSComputeVmprotectedItemTypeConverter))] + public partial interface IAzureIaaSComputeVmprotectedItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSComputeVmprotectedItem.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSComputeVmprotectedItem.TypeConverter.cs new file mode 100644 index 000000000000..15eb3eb4fb19 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSComputeVmprotectedItem.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureIaaSComputeVmprotectedItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSComputeVmprotectedItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSComputeVmprotectedItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureIaaSComputeVmprotectedItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureIaaSComputeVmprotectedItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureIaaSComputeVmprotectedItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSComputeVmprotectedItem.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSComputeVmprotectedItem.cs new file mode 100644 index 000000000000..90d1bdf5ea81 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSComputeVmprotectedItem.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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.Api20241115.IAzureIaaSComputeVmprotectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSComputeVmprotectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItem __azureIaaSvmProtectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).DiskExclusionPropertyDiskLunList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).DiskExclusionPropertyIsInclusionList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfo = value ?? null /* model class */; } + + /// The oldest backup copy available for this backup item. + [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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoOldestRecoveryPoint = 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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoPolicyInconsistent; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedInfoRecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IExtendedProperties ExtendedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDiskExclusionProperties ExtendedPropertyDiskExclusionProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedPropertyDiskExclusionProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ExtendedPropertyDiskExclusionProperty = value ?? null /* model class */; } + + /// 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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceHealthDetails[] HealthDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).HealthDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).HealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).HealthStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus)""); } + + /// 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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemKpisHealths KpisHealth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).KpisHealth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).LastBackupStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).LastBackupTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).PolicyId = 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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectedItemDataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).ProtectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemInternal)__azureIaaSvmProtectedItem).VirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureIaaSvmProtectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItem + { + + } + /// IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + internal partial interface IAzureIaaSComputeVmprotectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSComputeVmprotectedItem.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSComputeVmprotectedItem.json.cs new file mode 100644 index 000000000000..a2fab8515eaf --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSComputeVmprotectedItem.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.AzureIaaSvmProtectedItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSComputeVmprotectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSComputeVmprotectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmErrorInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmErrorInfo.PowerShell.cs new file mode 100644 index 000000000000..32e03af6952f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmErrorInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure IaaS VM workload-specific error information. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmErrorInfoTypeConverter))] + public partial class AzureIaaSvmErrorInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureIaaSvmErrorInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).ErrorCode = (int?) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).ErrorCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ErrorTitle")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).ErrorTitle = (string) content.GetValueForProperty("ErrorTitle",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).ErrorTitle, global::System.Convert.ToString); + } + if (content.Contains("ErrorString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).ErrorString = (string) content.GetValueForProperty("ErrorString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).ErrorString, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureIaaSvmErrorInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).ErrorCode = (int?) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).ErrorCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ErrorTitle")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).ErrorTitle = (string) content.GetValueForProperty("ErrorTitle",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).ErrorTitle, global::System.Convert.ToString); + } + if (content.Contains("ErrorString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).ErrorString = (string) content.GetValueForProperty("ErrorString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).ErrorString, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureIaaSvmErrorInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureIaaSvmErrorInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure IaaS VM workload-specific error information. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmErrorInfoTypeConverter))] + public partial interface IAzureIaaSvmErrorInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmErrorInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmErrorInfo.TypeConverter.cs new file mode 100644 index 000000000000..4b941ca4d3e0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmErrorInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureIaaSvmErrorInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureIaaSvmErrorInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureIaaSvmErrorInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureIaaSvmErrorInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmErrorInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmErrorInfo.cs new file mode 100644 index 000000000000..7ed5ee5c2813 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IAzureIaaSvmErrorInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmErrorInfoInternal.ErrorCode { get => this._errorCode; set { {_errorCode = value;} } } + + /// Internal Acessors for ErrorString + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal.ErrorString { get => this._errorString; set { {_errorString = value;} } } + + /// Internal Acessors for ErrorTitle + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfoInternal.ErrorTitle { get => this._errorTitle; set { {_errorTitle = value;} } } + + /// Internal Acessors for Recommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmErrorInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmErrorInfo.json.cs new file mode 100644 index 000000000000..87693f5197f3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmErrorInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureIaaSvmErrorInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmHealthDetails.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmHealthDetails.PowerShell.cs new file mode 100644 index 000000000000..5aaaf822f06c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmHealthDetails.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure IaaS VM workload-specific Health Details. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmHealthDetailsTypeConverter))] + public partial class AzureIaaSvmHealthDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureIaaSvmHealthDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Code = (int?) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Code, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Title")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Title, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureIaaSvmHealthDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Code = (int?) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Code, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Title")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Title, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmHealthDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureIaaSvmHealthDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmHealthDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureIaaSvmHealthDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmHealthDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure IaaS VM workload-specific Health Details. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmHealthDetailsTypeConverter))] + public partial interface IAzureIaaSvmHealthDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmHealthDetails.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmHealthDetails.TypeConverter.cs new file mode 100644 index 000000000000..a0fe949149c6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmHealthDetails.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureIaaSvmHealthDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmHealthDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmHealthDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureIaaSvmHealthDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureIaaSvmHealthDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureIaaSvmHealthDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmHealthDetails.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmHealthDetails.cs new file mode 100644 index 000000000000..d5eaaaa22f01 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IAzureIaaSvmHealthDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmHealthDetailsInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails __resourceHealthDetails = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IResourceHealthDetailsInternal)__resourceHealthDetails).Message; } + + /// Internal Acessors for Code + int? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)__resourceHealthDetails).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)__resourceHealthDetails).Code = value; } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)__resourceHealthDetails).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)__resourceHealthDetails).Message = value; } + + /// Internal Acessors for Recommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal.Recommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)__resourceHealthDetails).Recommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)__resourceHealthDetails).Recommendation = value; } + + /// Internal Acessors for Title + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal.Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)__resourceHealthDetails).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.IResourceHealthDetails + { + + } + /// Azure IaaS VM workload-specific Health Details. + internal partial interface IAzureIaaSvmHealthDetailsInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmHealthDetails.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmHealthDetails.json.cs new file mode 100644 index 000000000000..6bd5d71cf4df --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmHealthDetails.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.ResourceHealthDetails(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmHealthDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmHealthDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJob.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJob.PowerShell.cs new file mode 100644 index 000000000000..0cef0de9d2ff --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJob.PowerShell.cs @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure IaaS VM workload-specific job object. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmJobTypeConverter))] + public partial class AzureIaaSvmJob + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureIaaSvmJob(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("ActionsInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ActionsInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[]) content.GetValueForProperty("ActionsInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ActionsInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction.CreateFrom)); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfo[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmErrorInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("VirtualMachineVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).VirtualMachineVersion = (string) content.GetValueForProperty("VirtualMachineVersion",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).VirtualMachineVersion, global::System.Convert.ToString); + } + if (content.Contains("EntityFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName = (string) content.GetValueForProperty("EntityFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActivityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId = (string) content.GetValueForProperty("ActivityId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoTasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoTasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetails[]) content.GetValueForProperty("ExtendedInfoTasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoTasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedInfoPropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoPropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag) content.GetValueForProperty("ExtendedInfoPropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoPropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoInternalPropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoInternalPropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag) content.GetValueForProperty("ExtendedInfoInternalPropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoInternalPropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoInternalPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoProgressPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoProgressPercentage = (double?) content.GetValueForProperty("ExtendedInfoProgressPercentage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoProgressPercentage, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ExtendedInfoEstimatedRemainingDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoEstimatedRemainingDuration = (string) content.GetValueForProperty("ExtendedInfoEstimatedRemainingDuration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoEstimatedRemainingDuration, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoDynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoDynamicErrorMessage = (string) content.GetValueForProperty("ExtendedInfoDynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoDynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureIaaSvmJob(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("ActionsInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ActionsInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[]) content.GetValueForProperty("ActionsInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ActionsInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction.CreateFrom)); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmErrorInfo[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmErrorInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("VirtualMachineVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).VirtualMachineVersion = (string) content.GetValueForProperty("VirtualMachineVersion",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).VirtualMachineVersion, global::System.Convert.ToString); + } + if (content.Contains("EntityFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName = (string) content.GetValueForProperty("EntityFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActivityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId = (string) content.GetValueForProperty("ActivityId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoTasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoTasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetails[]) content.GetValueForProperty("ExtendedInfoTasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoTasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedInfoPropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoPropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag) content.GetValueForProperty("ExtendedInfoPropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoPropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoInternalPropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoInternalPropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag) content.GetValueForProperty("ExtendedInfoInternalPropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoInternalPropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoInternalPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoProgressPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoProgressPercentage = (double?) content.GetValueForProperty("ExtendedInfoProgressPercentage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoProgressPercentage, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ExtendedInfoEstimatedRemainingDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoEstimatedRemainingDuration = (string) content.GetValueForProperty("ExtendedInfoEstimatedRemainingDuration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoEstimatedRemainingDuration, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoDynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoDynamicErrorMessage = (string) content.GetValueForProperty("ExtendedInfoDynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal)this).ExtendedInfoDynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJob DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureIaaSvmJob(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJob DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureIaaSvmJob(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJob FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure IaaS VM workload-specific job object. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmJobTypeConverter))] + public partial interface IAzureIaaSvmJob + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJob.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJob.TypeConverter.cs new file mode 100644 index 000000000000..1c8621970285 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJob.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureIaaSvmJobTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJob ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJob).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureIaaSvmJob.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureIaaSvmJob.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureIaaSvmJob.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJob.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJob.cs new file mode 100644 index 000000000000..625325714fdc --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJob.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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.Api20241115.IAzureIaaSvmJob, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJob __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).ActivityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).EntityFriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)__job).EntityFriendlyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmErrorInfo[] ErrorDetail { get => this._errorDetail; set => this._errorDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmJobExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).EstimatedRemainingDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag ExtendedInfoInternalPropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).InternalPropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).ProgressPercentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmJobTaskDetails[] ExtendedInfoTasksList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).TasksList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)ExtendedInfo).TasksList = value ?? null /* arrayOf */; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureIaaSvmErrorInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 IAzureIaaSvmJobInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmErrorInfo[] ErrorDetail { get; set; } + /// Additional information for this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks associated with this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJob.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJob.json.cs new file mode 100644 index 000000000000..c01baf555aeb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJob.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.Job(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmErrorInfo) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmJob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..d5e30eeadbcb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfo.PowerShell.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure IaaS VM workload-specific additional information for job. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmJobExtendedInfoTypeConverter))] + public partial class AzureIaaSvmJobExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureIaaSvmJobExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).TasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetails[]) content.GetValueForProperty("TasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).TasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("InternalPropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).InternalPropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag) content.GetValueForProperty("InternalPropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).InternalPropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoInternalPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("ProgressPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).ProgressPercentage = (double?) content.GetValueForProperty("ProgressPercentage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).ProgressPercentage, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("EstimatedRemainingDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).EstimatedRemainingDuration = (string) content.GetValueForProperty("EstimatedRemainingDuration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).EstimatedRemainingDuration, global::System.Convert.ToString); + } + if (content.Contains("DynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).DynamicErrorMessage = (string) content.GetValueForProperty("DynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).DynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureIaaSvmJobExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).TasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetails[]) content.GetValueForProperty("TasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).TasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("InternalPropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).InternalPropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag) content.GetValueForProperty("InternalPropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).InternalPropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoInternalPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("ProgressPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).ProgressPercentage = (double?) content.GetValueForProperty("ProgressPercentage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).ProgressPercentage, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("EstimatedRemainingDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).EstimatedRemainingDuration = (string) content.GetValueForProperty("EstimatedRemainingDuration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).EstimatedRemainingDuration, global::System.Convert.ToString); + } + if (content.Contains("DynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).DynamicErrorMessage = (string) content.GetValueForProperty("DynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternal)this).DynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureIaaSvmJobExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureIaaSvmJobExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure IaaS VM workload-specific additional information for job. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmJobExtendedInfoTypeConverter))] + public partial interface IAzureIaaSvmJobExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..8aa404913dbc --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureIaaSvmJobExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureIaaSvmJobExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureIaaSvmJobExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureIaaSvmJobExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfo.cs new file mode 100644 index 000000000000..ba59a986bcdd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IAzureIaaSvmJobExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag InternalPropertyBag { get => (this._internalPropertyBag = this._internalPropertyBag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag _propertyBag; + + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag PropertyBag { get => (this._propertyBag = this._propertyBag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoPropertyBag()); set => this._propertyBag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag PropertyBag { get; set; } + /// List of tasks associated with this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetails[] TasksList { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfo.json.cs new file mode 100644 index 000000000000..357ddef50401 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureIaaSvmJobTaskDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobTaskDetails.FromJson(__u) )) ))() : null : TasksList;} + {_propertyBag = If( json?.PropertyT("propertyBag"), out var __jsonPropertyBag) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmJobExtendedInfoPropertyBag.FromJson(__jsonPropertyBag) : PropertyBag;} + {_internalPropertyBag = If( json?.PropertyT("internalPropertyBag"), out var __jsonInternalPropertyBag) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmJobExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoInternalPropertyBag.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoInternalPropertyBag.PowerShell.cs new file mode 100644 index 000000000000..7b35bbaa65ed --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoInternalPropertyBag.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Job internal properties. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmJobExtendedInfoInternalPropertyBagTypeConverter))] + public partial class AzureIaaSvmJobExtendedInfoInternalPropertyBag + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureIaaSvmJobExtendedInfoInternalPropertyBag(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureIaaSvmJobExtendedInfoInternalPropertyBag(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureIaaSvmJobExtendedInfoInternalPropertyBag(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureIaaSvmJobExtendedInfoInternalPropertyBag(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Job internal properties. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmJobExtendedInfoInternalPropertyBagTypeConverter))] + public partial interface IAzureIaaSvmJobExtendedInfoInternalPropertyBag + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoInternalPropertyBag.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoInternalPropertyBag.TypeConverter.cs new file mode 100644 index 000000000000..80956d585208 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoInternalPropertyBag.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureIaaSvmJobExtendedInfoInternalPropertyBagTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureIaaSvmJobExtendedInfoInternalPropertyBag.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureIaaSvmJobExtendedInfoInternalPropertyBag.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureIaaSvmJobExtendedInfoInternalPropertyBag.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoInternalPropertyBag.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoInternalPropertyBag.cs new file mode 100644 index 000000000000..d3fc43e76eb8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Job internal properties. + public partial class AzureIaaSvmJobExtendedInfoInternalPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoInternalPropertyBag.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoInternalPropertyBag.dictionary.cs new file mode 100644 index 000000000000..6335aad88b4f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.AzureIaaSvmJobExtendedInfoInternalPropertyBag source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoInternalPropertyBag.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoInternalPropertyBag.json.cs new file mode 100644 index 000000000000..f7bd186a0637 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoInternalPropertyBag.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoInternalPropertyBag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoPropertyBag.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoPropertyBag.PowerShell.cs new file mode 100644 index 000000000000..57d1d57e1c2f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoPropertyBag.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Job properties. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmJobExtendedInfoPropertyBagTypeConverter))] + public partial class AzureIaaSvmJobExtendedInfoPropertyBag + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureIaaSvmJobExtendedInfoPropertyBag(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureIaaSvmJobExtendedInfoPropertyBag(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureIaaSvmJobExtendedInfoPropertyBag(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureIaaSvmJobExtendedInfoPropertyBag(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Job properties. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmJobExtendedInfoPropertyBagTypeConverter))] + public partial interface IAzureIaaSvmJobExtendedInfoPropertyBag + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoPropertyBag.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoPropertyBag.TypeConverter.cs new file mode 100644 index 000000000000..8fd5fd1a660a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoPropertyBag.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureIaaSvmJobExtendedInfoPropertyBagTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureIaaSvmJobExtendedInfoPropertyBag.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureIaaSvmJobExtendedInfoPropertyBag.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureIaaSvmJobExtendedInfoPropertyBag.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoPropertyBag.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoPropertyBag.cs new file mode 100644 index 000000000000..89942be313a5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Job properties. + public partial class AzureIaaSvmJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoPropertyBag.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoPropertyBag.dictionary.cs new file mode 100644 index 000000000000..ad5d6d9ea647 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.AzureIaaSvmJobExtendedInfoPropertyBag source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoPropertyBag.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoPropertyBag.json.cs new file mode 100644 index 000000000000..6454294c6077 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobExtendedInfoPropertyBag.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobExtendedInfoPropertyBag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobTaskDetails.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobTaskDetails.PowerShell.cs new file mode 100644 index 000000000000..beb06a0f7845 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobTaskDetails.PowerShell.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure IaaS VM workload-specific job task details. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmJobTaskDetailsTypeConverter))] + public partial class AzureIaaSvmJobTaskDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureIaaSvmJobTaskDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).InstanceId = (string) content.GetValueForProperty("InstanceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).InstanceId, global::System.Convert.ToString); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ProgressPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).ProgressPercentage = (double?) content.GetValueForProperty("ProgressPercentage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).ProgressPercentage, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("TaskExecutionDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).TaskExecutionDetail = (string) content.GetValueForProperty("TaskExecutionDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).TaskExecutionDetail, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureIaaSvmJobTaskDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).InstanceId = (string) content.GetValueForProperty("InstanceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).InstanceId, global::System.Convert.ToString); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ProgressPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).ProgressPercentage = (double?) content.GetValueForProperty("ProgressPercentage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).ProgressPercentage, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("TaskExecutionDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).TaskExecutionDetail = (string) content.GetValueForProperty("TaskExecutionDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetailsInternal)this).TaskExecutionDetail, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureIaaSvmJobTaskDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureIaaSvmJobTaskDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure IaaS VM workload-specific job task details. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmJobTaskDetailsTypeConverter))] + public partial interface IAzureIaaSvmJobTaskDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobTaskDetails.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobTaskDetails.TypeConverter.cs new file mode 100644 index 000000000000..b6bbe0f66443 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobTaskDetails.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureIaaSvmJobTaskDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureIaaSvmJobTaskDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureIaaSvmJobTaskDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureIaaSvmJobTaskDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobTaskDetails.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobTaskDetails.cs new file mode 100644 index 000000000000..3f1c87ac5d7e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IAzureIaaSvmJobTaskDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobTaskDetails.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobTaskDetails.json.cs new file mode 100644 index 000000000000..a89eeeb460e1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmJobTaskDetails.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureIaaSvmJobTaskDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmJobTaskDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItem.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItem.PowerShell.cs new file mode 100644 index 000000000000..b5cb2bc1003c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItem.PowerShell.cs @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// IaaS VM workload-specific backup item. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmProtectedItemTypeConverter))] + public partial class AzureIaaSvmProtectedItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureIaaSvmProtectedItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedProperties) content.GetValueForProperty("ExtendedProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ExtendedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).VirtualMachineId = (string) content.GetValueForProperty("VirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).VirtualMachineId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("HealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus?) content.GetValueForProperty("HealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus.CreateFrom); + } + if (content.Contains("HealthDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails[]) content.GetValueForProperty("HealthDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceHealthDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupStatus = (string) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupStatus, global::System.Convert.ToString); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedItemDataId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectedItemDataId = (string) content.GetValueForProperty("ProtectedItemDataId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectedItemDataId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyInconsistent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoPolicyInconsistent = (bool?) content.GetValueForProperty("ExtendedInfoPolicyInconsistent",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoPolicyInconsistent, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedPropertyDiskExclusionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedPropertyDiskExclusionProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties) content.GetValueForProperty("ExtendedPropertyDiskExclusionProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedPropertyDiskExclusionProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskExclusionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DiskExclusionPropertyDiskLunList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyDiskLunList = (int[]) content.GetValueForProperty("DiskExclusionPropertyDiskLunList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyDiskLunList, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("DiskExclusionPropertyIsInclusionList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyIsInclusionList = (bool?) content.GetValueForProperty("DiskExclusionPropertyIsInclusionList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyIsInclusionList, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureIaaSvmProtectedItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedProperties) content.GetValueForProperty("ExtendedProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ExtendedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).VirtualMachineId = (string) content.GetValueForProperty("VirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).VirtualMachineId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("HealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus?) content.GetValueForProperty("HealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatus.CreateFrom); + } + if (content.Contains("HealthDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails[]) content.GetValueForProperty("HealthDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).HealthDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceHealthDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupStatus = (string) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupStatus, global::System.Convert.ToString); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedItemDataId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectedItemDataId = (string) content.GetValueForProperty("ProtectedItemDataId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ProtectedItemDataId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyInconsistent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoPolicyInconsistent = (bool?) content.GetValueForProperty("ExtendedInfoPolicyInconsistent",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedInfoPolicyInconsistent, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedPropertyDiskExclusionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedPropertyDiskExclusionProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties) content.GetValueForProperty("ExtendedPropertyDiskExclusionProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).ExtendedPropertyDiskExclusionProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskExclusionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DiskExclusionPropertyDiskLunList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyDiskLunList = (int[]) content.GetValueForProperty("DiskExclusionPropertyDiskLunList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyDiskLunList, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("DiskExclusionPropertyIsInclusionList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyIsInclusionList = (bool?) content.GetValueForProperty("DiskExclusionPropertyIsInclusionList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal)this).DiskExclusionPropertyIsInclusionList, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureIaaSvmProtectedItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureIaaSvmProtectedItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// IaaS VM workload-specific backup item. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmProtectedItemTypeConverter))] + public partial interface IAzureIaaSvmProtectedItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItem.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItem.TypeConverter.cs new file mode 100644 index 000000000000..072641d319be --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItem.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureIaaSvmProtectedItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureIaaSvmProtectedItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureIaaSvmProtectedItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureIaaSvmProtectedItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItem.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItem.cs new file mode 100644 index 000000000000..600d01621336 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItem.cs @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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.Api20241115.IAzureIaaSvmProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IExtendedPropertiesInternal)ExtendedProperty).DiskExclusionPropertyDiskLunList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IExtendedPropertiesInternal)ExtendedProperty).DiskExclusionPropertyIsInclusionList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal)ExtendedProperty).DiskExclusionPropertyIsInclusionList = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemExtendedInfo()); set => this._extendedInfo = value; } + + /// The oldest backup copy available for this backup item. + [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.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint = 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.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).PolicyInconsistent; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IExtendedProperties ExtendedProperty { get => (this._extendedProperty = this._extendedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ExtendedProperties()); set => this._extendedProperty = value; } + + /// 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.Api20241115.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.Api20241115.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 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.Api20241115.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemKpisHealths KpisHealth { get => (this._kpisHealth = this._kpisHealth ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemExtendedInfo()); set { {_extendedInfo = value;} } } + + /// Internal Acessors for ExtendedProperty + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedProperties Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal.ExtendedProperty { get => (this._extendedProperty = this._extendedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ExtendedProperties()); set { {_extendedProperty = value;} } } + + /// Internal Acessors for ExtendedPropertyDiskExclusionProperty + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemInternal.ExtendedPropertyDiskExclusionProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal)ExtendedProperty).DiskExclusionProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).PolicyId = 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.Api20241115.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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 oldest backup copy available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item.", + SerializedName = @"oldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoOldestRecoveryPoint { 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; } + /// 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.Api20241115.IResourceHealthDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemKpisHealths) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo ExtendedInfo { get; set; } + /// The oldest backup copy available for this backup item. + global::System.DateTime? ExtendedInfoOldestRecoveryPoint { 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.Api20241115.IExtendedProperties ExtendedProperty { get; set; } + /// Extended Properties for Disk Exclusion. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties ExtendedPropertyDiskExclusionProperty { 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.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItem.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItem.json.cs new file mode 100644 index 000000000000..b7bac3aea046 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItem.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.ProtectedItem(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + {_extendedProperty = If( json?.PropertyT("extendedProperties"), out var __jsonExtendedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceHealthDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceHealthDetails.FromJson(__u) )) ))() : null : HealthDetail;} + {_kpisHealth = If( json?.PropertyT("kpisHealths"), out var __jsonKpisHealths) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItem. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureIaaSvmProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..368c6bf2916a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemExtendedInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Additional information on Azure IaaS VM specific backup item. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmProtectedItemExtendedInfoTypeConverter))] + public partial class AzureIaaSvmProtectedItemExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureIaaSvmProtectedItemExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)this).RecoveryPointCount = (int?) content.GetValueForProperty("RecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)this).RecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PolicyInconsistent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)this).PolicyInconsistent = (bool?) content.GetValueForProperty("PolicyInconsistent",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)this).PolicyInconsistent, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureIaaSvmProtectedItemExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)this).RecoveryPointCount = (int?) content.GetValueForProperty("RecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)this).RecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PolicyInconsistent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)this).PolicyInconsistent = (bool?) content.GetValueForProperty("PolicyInconsistent",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal)this).PolicyInconsistent, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureIaaSvmProtectedItemExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureIaaSvmProtectedItemExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Additional information on Azure IaaS VM specific backup item. + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmProtectedItemExtendedInfoTypeConverter))] + public partial interface IAzureIaaSvmProtectedItemExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..b5e150d87e4d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemExtendedInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureIaaSvmProtectedItemExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureIaaSvmProtectedItemExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureIaaSvmProtectedItemExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureIaaSvmProtectedItemExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..d674358d3865 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemExtendedInfo.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.Api20241115 +{ + 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.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfoInternal + { + + /// Backing field for property. + private global::System.DateTime? _oldestRecoveryPoint; + + /// The oldest backup copy available for this backup item. + [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 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 oldest backup copy available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item.", + SerializedName = @"oldestRecoveryPoint", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OldestRecoveryPoint { 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 oldest backup copy available for this backup item. + global::System.DateTime? OldestRecoveryPoint { 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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemExtendedInfo.json.cs new file mode 100644 index 000000000000..91620ed6b0ff --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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;} + {_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.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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._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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemKpisHealths.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemKpisHealths.PowerShell.cs new file mode 100644 index 000000000000..009388553884 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemKpisHealths.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Health details of different KPIs + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmProtectedItemKpisHealthsTypeConverter))] + public partial class AzureIaaSvmProtectedItemKpisHealths + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureIaaSvmProtectedItemKpisHealths(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureIaaSvmProtectedItemKpisHealths(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemKpisHealths DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureIaaSvmProtectedItemKpisHealths(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemKpisHealths DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureIaaSvmProtectedItemKpisHealths(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemKpisHealths FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Health details of different KPIs + [System.ComponentModel.TypeConverter(typeof(AzureIaaSvmProtectedItemKpisHealthsTypeConverter))] + public partial interface IAzureIaaSvmProtectedItemKpisHealths + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemKpisHealths.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemKpisHealths.TypeConverter.cs new file mode 100644 index 000000000000..3fff4b20ff80 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemKpisHealths.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureIaaSvmProtectedItemKpisHealthsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemKpisHealths ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemKpisHealths).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureIaaSvmProtectedItemKpisHealths.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureIaaSvmProtectedItemKpisHealths.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureIaaSvmProtectedItemKpisHealths.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemKpisHealths.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemKpisHealths.cs new file mode 100644 index 000000000000..e39492f17ab7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Health details of different KPIs + public partial class AzureIaaSvmProtectedItemKpisHealths : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemKpisHealths, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemKpisHealths.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemKpisHealths.dictionary.cs new file mode 100644 index 000000000000..89fb77614cc6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.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.Api20241115.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.Api20241115.IKpiResourceHealthDetails value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureIaaSvmProtectedItemKpisHealths source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemKpisHealths.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemKpisHealths.json.cs new file mode 100644 index 000000000000..343c2c7c75b7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureIaaSvmProtectedItemKpisHealths.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.KpiResourceHealthDetails.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemKpisHealths. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureIaaSvmProtectedItemKpisHealths. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItem.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItem.PowerShell.cs new file mode 100644 index 000000000000..1fa038cdd9f6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItem.PowerShell.cs @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure SQL workload-specific backup item. + [System.ComponentModel.TypeConverter(typeof(AzureSqlProtectedItemTypeConverter))] + public partial class AzureSqlProtectedItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureSqlProtectedItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureSqlProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ProtectedItemDataId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ProtectedItemDataId = (string) content.GetValueForProperty("ProtectedItemDataId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ProtectedItemDataId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfoPolicyState = (string) content.GetValueForProperty("ExtendedInfoPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfoPolicyState, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureSqlProtectedItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureSqlProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ProtectedItemDataId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ProtectedItemDataId = (string) content.GetValueForProperty("ProtectedItemDataId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ProtectedItemDataId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfoPolicyState = (string) content.GetValueForProperty("ExtendedInfoPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal)this).ExtendedInfoPolicyState, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureSqlProtectedItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureSqlProtectedItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure SQL workload-specific backup item. + [System.ComponentModel.TypeConverter(typeof(AzureSqlProtectedItemTypeConverter))] + public partial interface IAzureSqlProtectedItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItem.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItem.TypeConverter.cs new file mode 100644 index 000000000000..4860d635f598 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItem.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureSqlProtectedItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureSqlProtectedItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureSqlProtectedItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureSqlProtectedItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItem.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItem.cs new file mode 100644 index 000000000000..bf2026c6109e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItem.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.Api20241115 +{ + 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.Api20241115.IAzureSqlProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureSqlProtectedItemExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)ExtendedInfo).PolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount = value ?? default(int); } + + /// 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.Api20241115.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).PolicyId = 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.Api20241115.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IProtectedItemInternal + { + /// Additional information for this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItem.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItem.json.cs new file mode 100644 index 000000000000..494f53a506e9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItem.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.ProtectedItem(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureSqlProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItemExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItemExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..ea8c2789ab49 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItemExtendedInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Additional information on Azure Sql specific protected item. + [System.ComponentModel.TypeConverter(typeof(AzureSqlProtectedItemExtendedInfoTypeConverter))] + public partial class AzureSqlProtectedItemExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureSqlProtectedItemExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)this).RecoveryPointCount = (int?) content.GetValueForProperty("RecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)this).RecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)this).PolicyState = (string) content.GetValueForProperty("PolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)this).PolicyState, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureSqlProtectedItemExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)this).RecoveryPointCount = (int?) content.GetValueForProperty("RecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)this).RecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)this).PolicyState = (string) content.GetValueForProperty("PolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfoInternal)this).PolicyState, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureSqlProtectedItemExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureSqlProtectedItemExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Additional information on Azure Sql specific protected item. + [System.ComponentModel.TypeConverter(typeof(AzureSqlProtectedItemExtendedInfoTypeConverter))] + public partial interface IAzureSqlProtectedItemExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItemExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItemExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..5e079c1abaac --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItemExtendedInfo.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureSqlProtectedItemExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureSqlProtectedItemExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureSqlProtectedItemExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureSqlProtectedItemExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItemExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..113892004273 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IAzureSqlProtectedItemExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItemExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItemExtendedInfo.json.cs new file mode 100644 index 000000000000..580fefc6111e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureSqlProtectedItemExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureSqlProtectedItemExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureSqlProtectedItemExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureStorageErrorInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageErrorInfo.PowerShell.cs new file mode 100644 index 000000000000..b9f45a755f34 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageErrorInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure storage specific error information + [System.ComponentModel.TypeConverter(typeof(AzureStorageErrorInfoTypeConverter))] + public partial class AzureStorageErrorInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureStorageErrorInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfoInternal)this).ErrorCode = (int?) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfoInternal)this).ErrorCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ErrorString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfoInternal)this).ErrorString = (string) content.GetValueForProperty("ErrorString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfoInternal)this).ErrorString, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfoInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfoInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureStorageErrorInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfoInternal)this).ErrorCode = (int?) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfoInternal)this).ErrorCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ErrorString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfoInternal)this).ErrorString = (string) content.GetValueForProperty("ErrorString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfoInternal)this).ErrorString, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfoInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfoInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureStorageErrorInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureStorageErrorInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure storage specific error information + [System.ComponentModel.TypeConverter(typeof(AzureStorageErrorInfoTypeConverter))] + public partial interface IAzureStorageErrorInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageErrorInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageErrorInfo.TypeConverter.cs new file mode 100644 index 000000000000..fb623af187a8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageErrorInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureStorageErrorInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureStorageErrorInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureStorageErrorInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureStorageErrorInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageErrorInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageErrorInfo.cs new file mode 100644 index 000000000000..c48b6b7992c3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure storage specific error information + public partial class AzureStorageErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureStorageErrorInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageErrorInfo.json.cs new file mode 100644 index 000000000000..64ff372376d3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageErrorInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureStorageErrorInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureStorageJob.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJob.PowerShell.cs new file mode 100644 index 000000000000..b7b849b8e6a4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJob.PowerShell.cs @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure storage specific job. + [System.ComponentModel.TypeConverter(typeof(AzureStorageJobTypeConverter))] + public partial class AzureStorageJob + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureStorageJob(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("ActionsInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ActionsInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[]) content.GetValueForProperty("ActionsInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ActionsInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction.CreateFrom)); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfo[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageErrorInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("StorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).StorageAccountName = (string) content.GetValueForProperty("StorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).StorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).StorageAccountVersion = (string) content.GetValueForProperty("StorageAccountVersion",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).StorageAccountVersion, global::System.Convert.ToString); + } + if (content.Contains("EntityFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName = (string) content.GetValueForProperty("EntityFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActivityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId = (string) content.GetValueForProperty("ActivityId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoTasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfoTasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetails[]) content.GetValueForProperty("ExtendedInfoTasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfoTasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedInfoPropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfoPropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoPropertyBag) content.GetValueForProperty("ExtendedInfoPropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfoPropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoDynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfoDynamicErrorMessage = (string) content.GetValueForProperty("ExtendedInfoDynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfoDynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureStorageJob(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("ActionsInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ActionsInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[]) content.GetValueForProperty("ActionsInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ActionsInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction.CreateFrom)); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageErrorInfo[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageErrorInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("StorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).StorageAccountName = (string) content.GetValueForProperty("StorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).StorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).StorageAccountVersion = (string) content.GetValueForProperty("StorageAccountVersion",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).StorageAccountVersion, global::System.Convert.ToString); + } + if (content.Contains("EntityFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName = (string) content.GetValueForProperty("EntityFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActivityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId = (string) content.GetValueForProperty("ActivityId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoTasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfoTasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetails[]) content.GetValueForProperty("ExtendedInfoTasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfoTasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedInfoPropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfoPropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoPropertyBag) content.GetValueForProperty("ExtendedInfoPropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfoPropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoDynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfoDynamicErrorMessage = (string) content.GetValueForProperty("ExtendedInfoDynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal)this).ExtendedInfoDynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJob DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureStorageJob(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJob DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureStorageJob(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJob FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure storage specific job. + [System.ComponentModel.TypeConverter(typeof(AzureStorageJobTypeConverter))] + public partial interface IAzureStorageJob + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJob.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJob.TypeConverter.cs new file mode 100644 index 000000000000..07a9bda0485b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJob.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureStorageJobTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJob ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJob).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureStorageJob.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureStorageJob.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureStorageJob.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJob.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJob.cs new file mode 100644 index 000000000000..cd09a475f217 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJob.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure storage specific job. + public partial class AzureStorageJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJob, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJob __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).ActivityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).EntityFriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)__job).EntityFriendlyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureStorageErrorInfo[] ErrorDetail { get => this._errorDetail; set => this._errorDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureStorageJobExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureStorageJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureStorageJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoInternal)ExtendedInfo).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureStorageJobTaskDetails[] ExtendedInfoTasksList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoInternal)ExtendedInfo).TasksList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoInternal)ExtendedInfo).TasksList = value ?? null /* arrayOf */; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureStorageErrorInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureStorageJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureStorageJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetails[] ExtendedInfoTasksList { 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.Api20241115.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.Api20241115.IAzureStorageErrorInfo[] ErrorDetail { get; set; } + /// Additional information about the job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfo ExtendedInfo { get; set; } + /// Non localized error message on job execution. + string ExtendedInfoDynamicErrorMessage { get; set; } + /// Job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks for this job + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetails[] ExtendedInfoTasksList { 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.DefaultTag/generated/api/Models/Api20241115/AzureStorageJob.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJob.json.cs new file mode 100644 index 000000000000..f90ea17224e1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.Job(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureStorageErrorInfo) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..fef82cdc9b01 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure Storage workload-specific additional information for job. + [System.ComponentModel.TypeConverter(typeof(AzureStorageJobExtendedInfoTypeConverter))] + public partial class AzureStorageJobExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureStorageJobExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoInternal)this).TasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetails[]) content.GetValueForProperty("TasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoInternal)this).TasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("DynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoInternal)this).DynamicErrorMessage = (string) content.GetValueForProperty("DynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoInternal)this).DynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureStorageJobExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoInternal)this).TasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetails[]) content.GetValueForProperty("TasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoInternal)this).TasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("DynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoInternal)this).DynamicErrorMessage = (string) content.GetValueForProperty("DynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoInternal)this).DynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureStorageJobExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureStorageJobExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure Storage workload-specific additional information for job. + [System.ComponentModel.TypeConverter(typeof(AzureStorageJobExtendedInfoTypeConverter))] + public partial interface IAzureStorageJobExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..c275e4c5a460 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureStorageJobExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureStorageJobExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureStorageJobExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureStorageJobExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfo.cs new file mode 100644 index 000000000000..6f8f0e70f12a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IAzureStorageJobExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureStorageJobExtendedInfoPropertyBag _propertyBag; + + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoPropertyBag PropertyBag { get => (this._propertyBag = this._propertyBag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobExtendedInfoPropertyBag()); set => this._propertyBag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureStorageJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureStorageJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureStorageJobExtendedInfoPropertyBag PropertyBag { get; set; } + /// List of tasks for this job + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetails[] TasksList { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfo.json.cs new file mode 100644 index 000000000000..9a6fa77036fb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureStorageJobTaskDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureStorageJobTaskDetails.FromJson(__u) )) ))() : null : TasksList;} + {_propertyBag = If( json?.PropertyT("propertyBag"), out var __jsonPropertyBag) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureStorageJobExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfoPropertyBag.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfoPropertyBag.PowerShell.cs new file mode 100644 index 000000000000..212061cffea3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfoPropertyBag.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Job properties. + [System.ComponentModel.TypeConverter(typeof(AzureStorageJobExtendedInfoPropertyBagTypeConverter))] + public partial class AzureStorageJobExtendedInfoPropertyBag + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureStorageJobExtendedInfoPropertyBag(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureStorageJobExtendedInfoPropertyBag(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoPropertyBag DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureStorageJobExtendedInfoPropertyBag(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoPropertyBag DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureStorageJobExtendedInfoPropertyBag(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoPropertyBag FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Job properties. + [System.ComponentModel.TypeConverter(typeof(AzureStorageJobExtendedInfoPropertyBagTypeConverter))] + public partial interface IAzureStorageJobExtendedInfoPropertyBag + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfoPropertyBag.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfoPropertyBag.TypeConverter.cs new file mode 100644 index 000000000000..e3d8f3907732 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfoPropertyBag.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureStorageJobExtendedInfoPropertyBagTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoPropertyBag ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoPropertyBag).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureStorageJobExtendedInfoPropertyBag.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureStorageJobExtendedInfoPropertyBag.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureStorageJobExtendedInfoPropertyBag.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfoPropertyBag.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfoPropertyBag.cs new file mode 100644 index 000000000000..9eb78ddbab6d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Job properties. + public partial class AzureStorageJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoPropertyBag, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfoPropertyBag.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfoPropertyBag.dictionary.cs new file mode 100644 index 000000000000..2341f0c9c3f7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.AzureStorageJobExtendedInfoPropertyBag source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfoPropertyBag.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfoPropertyBag.json.cs new file mode 100644 index 000000000000..f0e360630c4e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobExtendedInfoPropertyBag.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureStorageJobExtendedInfoPropertyBag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobExtendedInfoPropertyBag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobTaskDetails.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobTaskDetails.PowerShell.cs new file mode 100644 index 000000000000..bddf89cb15fa --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobTaskDetails.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure storage workload specific job task details. + [System.ComponentModel.TypeConverter(typeof(AzureStorageJobTaskDetailsTypeConverter))] + public partial class AzureStorageJobTaskDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureStorageJobTaskDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetailsInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetailsInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetailsInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetailsInternal)this).Status, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureStorageJobTaskDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetailsInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetailsInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetailsInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetailsInternal)this).Status, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureStorageJobTaskDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureStorageJobTaskDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure storage workload specific job task details. + [System.ComponentModel.TypeConverter(typeof(AzureStorageJobTaskDetailsTypeConverter))] + public partial interface IAzureStorageJobTaskDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobTaskDetails.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobTaskDetails.TypeConverter.cs new file mode 100644 index 000000000000..99fc40cecfb5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobTaskDetails.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureStorageJobTaskDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureStorageJobTaskDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureStorageJobTaskDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureStorageJobTaskDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobTaskDetails.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobTaskDetails.cs new file mode 100644 index 000000000000..7f4a7fc36e41 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IAzureStorageJobTaskDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobTaskDetails.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobTaskDetails.json.cs new file mode 100644 index 000000000000..33af20a0af64 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureStorageJobTaskDetails.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureStorageJobTaskDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureStorageJobTaskDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItem.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItem.PowerShell.cs new file mode 100644 index 000000000000..3c44678233cf --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItem.PowerShell.cs @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure VM workload-specific protected item. + [System.ComponentModel.TypeConverter(typeof(AzureVMWorkloadProtectedItemTypeConverter))] + public partial class AzureVMWorkloadProtectedItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureVMWorkloadProtectedItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LastBackupErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetail) content.GetValueForProperty("LastBackupErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("ParentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName = (string) content.GetValueForProperty("ParentName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName, global::System.Convert.ToString); + } + if (content.Contains("ParentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType = (string) content.GetValueForProperty("ParentType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus?) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus.CreateFrom); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedItemDataSourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId = (string) content.GetValueForProperty("ProtectedItemDataSourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId, global::System.Convert.ToString); + } + if (content.Contains("ProtectedItemHealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus?) content.GetValueForProperty("ProtectedItemHealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus.CreateFrom); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LastBackupErrorDetailCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode = (string) content.GetValueForProperty("LastBackupErrorDetailCode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage = (string) content.GetValueForProperty("LastBackupErrorDetailMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailRecommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation = (string[]) content.GetValueForProperty("LastBackupErrorDetailRecommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState = (string) content.GetValueForProperty("ExtendedInfoPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureVMWorkloadProtectedItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LastBackupErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetail) content.GetValueForProperty("LastBackupErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("ParentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName = (string) content.GetValueForProperty("ParentName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName, global::System.Convert.ToString); + } + if (content.Contains("ParentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType = (string) content.GetValueForProperty("ParentType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus?) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus.CreateFrom); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedItemDataSourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId = (string) content.GetValueForProperty("ProtectedItemDataSourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId, global::System.Convert.ToString); + } + if (content.Contains("ProtectedItemHealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus?) content.GetValueForProperty("ProtectedItemHealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus.CreateFrom); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LastBackupErrorDetailCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode = (string) content.GetValueForProperty("LastBackupErrorDetailCode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage = (string) content.GetValueForProperty("LastBackupErrorDetailMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailRecommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation = (string[]) content.GetValueForProperty("LastBackupErrorDetailRecommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState = (string) content.GetValueForProperty("ExtendedInfoPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureVMWorkloadProtectedItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureVMWorkloadProtectedItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure VM workload-specific protected item. + [System.ComponentModel.TypeConverter(typeof(AzureVMWorkloadProtectedItemTypeConverter))] + public partial interface IAzureVMWorkloadProtectedItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItem.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItem.TypeConverter.cs new file mode 100644 index 000000000000..d53f1c970e5f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItem.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureVMWorkloadProtectedItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureVMWorkloadProtectedItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureVMWorkloadProtectedItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureVMWorkloadProtectedItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItem.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItem.cs new file mode 100644 index 000000000000..c88d96941d21 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItem.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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.Api20241115.IAzureVMWorkloadProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemExtendedInfo()); set => this._extendedInfo = value; } + + /// The oldest backup copy available for this backup item. + [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.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)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.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).PolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).PolicyState = 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.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 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.Api20241115.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths KpisHealth { get => (this._kpisHealth = this._kpisHealth ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemKpisHealths()); set => this._kpisHealth = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IErrorDetail LastBackupErrorDetail { get => (this._lastBackupErrorDetail = this._lastBackupErrorDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemExtendedInfo()); set { {_extendedInfo = value;} } } + + /// Internal Acessors for LastBackupErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetail { get => (this._lastBackupErrorDetail = this._lastBackupErrorDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ErrorDetail()); set { {_lastBackupErrorDetail = value;} } } + + /// Internal Acessors for LastBackupErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)LastBackupErrorDetail).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)LastBackupErrorDetail).Code = value; } + + /// Internal Acessors for LastBackupErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)LastBackupErrorDetail).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)LastBackupErrorDetail).Message = value; } + + /// Internal Acessors for LastBackupErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)LastBackupErrorDetail).Recommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).PolicyId = 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.Api20241115.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItem + { + /// The oldest backup copy available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item.", + 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 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.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal + { + /// Additional information for this backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo ExtendedInfo { get; set; } + /// The oldest backup copy available for this backup item. + global::System.DateTime? ExtendedInfoOldestRecoveryPoint { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + string ExtendedInfoPolicyState { 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.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths KpisHealth { get; set; } + /// Error details in last backup + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItem.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItem.json.cs new file mode 100644 index 000000000000..fbd7e5790ec7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItem.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.ProtectedItem(json); + {_lastBackupErrorDetail = If( json?.PropertyT("lastBackupErrorDetail"), out var __jsonLastBackupErrorDetail) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ErrorDetail.FromJson(__jsonLastBackupErrorDetail) : LastBackupErrorDetail;} + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.AzureVMWorkloadProtectedItemKpisHealths.FromJson(__jsonKpisHealths) : KpisHealth;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItem. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..582da56aefa0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemExtendedInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Additional information on Azure Workload for SQL specific backup item. + [System.ComponentModel.TypeConverter(typeof(AzureVMWorkloadProtectedItemExtendedInfoTypeConverter))] + public partial class AzureVMWorkloadProtectedItemExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureVMWorkloadProtectedItemExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)this).RecoveryPointCount = (int?) content.GetValueForProperty("RecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)this).RecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)this).PolicyState = (string) content.GetValueForProperty("PolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)this).PolicyState, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureVMWorkloadProtectedItemExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)this).RecoveryPointCount = (int?) content.GetValueForProperty("RecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)this).RecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)this).PolicyState = (string) content.GetValueForProperty("PolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal)this).PolicyState, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureVMWorkloadProtectedItemExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureVMWorkloadProtectedItemExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Additional information on Azure Workload for SQL specific backup item. + [System.ComponentModel.TypeConverter(typeof(AzureVMWorkloadProtectedItemExtendedInfoTypeConverter))] + public partial interface IAzureVMWorkloadProtectedItemExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..598c48ce00c5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemExtendedInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureVMWorkloadProtectedItemExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureVMWorkloadProtectedItemExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureVMWorkloadProtectedItemExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureVMWorkloadProtectedItemExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..94b7eb7f38cc --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemExtendedInfo.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.Api20241115 +{ + 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.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfoInternal + { + + /// Backing field for property. + private global::System.DateTime? _oldestRecoveryPoint; + + /// The oldest backup copy available for this backup item. + [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 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 oldest backup copy available for this backup item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The oldest backup copy available for this backup item.", + 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 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 oldest backup copy available for this backup item. + global::System.DateTime? OldestRecoveryPoint { get; set; } + /// Indicates consistency of policy object and policy applied to this backup item. + string PolicyState { 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.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemExtendedInfo.json.cs new file mode 100644 index 000000000000..b2de7afbe22c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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;} + {_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.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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._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.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemKpisHealths.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemKpisHealths.PowerShell.cs new file mode 100644 index 000000000000..b4d0cee21dd7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemKpisHealths.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Health details of different KPIs + [System.ComponentModel.TypeConverter(typeof(AzureVMWorkloadProtectedItemKpisHealthsTypeConverter))] + public partial class AzureVMWorkloadProtectedItemKpisHealths + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureVMWorkloadProtectedItemKpisHealths(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureVMWorkloadProtectedItemKpisHealths(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureVMWorkloadProtectedItemKpisHealths(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureVMWorkloadProtectedItemKpisHealths(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Health details of different KPIs + [System.ComponentModel.TypeConverter(typeof(AzureVMWorkloadProtectedItemKpisHealthsTypeConverter))] + public partial interface IAzureVMWorkloadProtectedItemKpisHealths + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemKpisHealths.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemKpisHealths.TypeConverter.cs new file mode 100644 index 000000000000..30a6cb6d16d1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemKpisHealths.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureVMWorkloadProtectedItemKpisHealthsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureVMWorkloadProtectedItemKpisHealths.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureVMWorkloadProtectedItemKpisHealths.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureVMWorkloadProtectedItemKpisHealths.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemKpisHealths.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemKpisHealths.cs new file mode 100644 index 000000000000..7370c8bcf161 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Health details of different KPIs + public partial class AzureVMWorkloadProtectedItemKpisHealths : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemKpisHealths.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemKpisHealths.dictionary.cs new file mode 100644 index 000000000000..7503be40898f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.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.Api20241115.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.Api20241115.IKpiResourceHealthDetails value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemKpisHealths source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemKpisHealths.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemKpisHealths.json.cs new file mode 100644 index 000000000000..d411b9cf3095 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadProtectedItemKpisHealths.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.KpiResourceHealthDetails.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapAseDatabaseProtectedItem.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapAseDatabaseProtectedItem.PowerShell.cs new file mode 100644 index 000000000000..3cdffb247903 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapAseDatabaseProtectedItem.PowerShell.cs @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure VM workload-specific protected item representing SAP ASE Database. + [System.ComponentModel.TypeConverter(typeof(AzureVMWorkloadSapAseDatabaseProtectedItemTypeConverter))] + public partial class AzureVMWorkloadSapAseDatabaseProtectedItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureVMWorkloadSapAseDatabaseProtectedItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LastBackupErrorDetailCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode = (string) content.GetValueForProperty("LastBackupErrorDetailCode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage = (string) content.GetValueForProperty("LastBackupErrorDetailMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailRecommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation = (string[]) content.GetValueForProperty("LastBackupErrorDetailRecommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState = (string) content.GetValueForProperty("ExtendedInfoPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetail) content.GetValueForProperty("LastBackupErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("ParentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName = (string) content.GetValueForProperty("ParentName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName, global::System.Convert.ToString); + } + if (content.Contains("ParentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType = (string) content.GetValueForProperty("ParentType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus?) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus.CreateFrom); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedItemDataSourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId = (string) content.GetValueForProperty("ProtectedItemDataSourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId, global::System.Convert.ToString); + } + if (content.Contains("ProtectedItemHealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus?) content.GetValueForProperty("ProtectedItemHealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus.CreateFrom); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureVMWorkloadSapAseDatabaseProtectedItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LastBackupErrorDetailCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode = (string) content.GetValueForProperty("LastBackupErrorDetailCode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage = (string) content.GetValueForProperty("LastBackupErrorDetailMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailRecommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation = (string[]) content.GetValueForProperty("LastBackupErrorDetailRecommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState = (string) content.GetValueForProperty("ExtendedInfoPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetail) content.GetValueForProperty("LastBackupErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("ParentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName = (string) content.GetValueForProperty("ParentName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName, global::System.Convert.ToString); + } + if (content.Contains("ParentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType = (string) content.GetValueForProperty("ParentType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus?) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus.CreateFrom); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedItemDataSourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId = (string) content.GetValueForProperty("ProtectedItemDataSourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId, global::System.Convert.ToString); + } + if (content.Contains("ProtectedItemHealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus?) content.GetValueForProperty("ProtectedItemHealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus.CreateFrom); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapAseDatabaseProtectedItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureVMWorkloadSapAseDatabaseProtectedItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapAseDatabaseProtectedItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureVMWorkloadSapAseDatabaseProtectedItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapAseDatabaseProtectedItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure VM workload-specific protected item representing SAP ASE Database. + [System.ComponentModel.TypeConverter(typeof(AzureVMWorkloadSapAseDatabaseProtectedItemTypeConverter))] + public partial interface IAzureVMWorkloadSapAseDatabaseProtectedItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapAseDatabaseProtectedItem.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapAseDatabaseProtectedItem.TypeConverter.cs new file mode 100644 index 000000000000..69937f1f00c5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapAseDatabaseProtectedItem.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureVMWorkloadSapAseDatabaseProtectedItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapAseDatabaseProtectedItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapAseDatabaseProtectedItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureVMWorkloadSapAseDatabaseProtectedItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureVMWorkloadSapAseDatabaseProtectedItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureVMWorkloadSapAseDatabaseProtectedItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapAseDatabaseProtectedItem.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapAseDatabaseProtectedItem.cs new file mode 100644 index 000000000000..8641300e472d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapAseDatabaseProtectedItem.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.Api20241115 +{ + 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.Api20241115.IAzureVMWorkloadSapAseDatabaseProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapAseDatabaseProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItem __azureVMWorkloadProtectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfo = value ?? null /* model class */; } + + /// The oldest backup copy available for this backup item. + [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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPoint = 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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoPolicyState = 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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoRecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).FriendlyName = value ?? null; } + + /// 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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths KpisHealth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).KpisHealth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IErrorDetail LastBackupErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for LastBackupErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailCode = value; } + + /// Internal Acessors for LastBackupErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailMessage = value; } + + /// Internal Acessors for LastBackupErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailRecommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyId = 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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemDataSourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemHealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItem + { + + } + /// Azure VM workload-specific protected item representing SAP ASE Database. + internal partial interface IAzureVMWorkloadSapAseDatabaseProtectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapAseDatabaseProtectedItem.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapAseDatabaseProtectedItem.json.cs new file mode 100644 index 000000000000..f0e5962e6162 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapAseDatabaseProtectedItem.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.AzureVMWorkloadProtectedItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapAseDatabaseProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapAseDatabaseProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapHanaDatabaseProtectedItem.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapHanaDatabaseProtectedItem.PowerShell.cs new file mode 100644 index 000000000000..b253f91a73b1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapHanaDatabaseProtectedItem.PowerShell.cs @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure VM workload-specific protected item representing SAP HANA Database. + [System.ComponentModel.TypeConverter(typeof(AzureVMWorkloadSapHanaDatabaseProtectedItemTypeConverter))] + public partial class AzureVMWorkloadSapHanaDatabaseProtectedItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureVMWorkloadSapHanaDatabaseProtectedItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LastBackupErrorDetailCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode = (string) content.GetValueForProperty("LastBackupErrorDetailCode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage = (string) content.GetValueForProperty("LastBackupErrorDetailMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailRecommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation = (string[]) content.GetValueForProperty("LastBackupErrorDetailRecommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState = (string) content.GetValueForProperty("ExtendedInfoPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetail) content.GetValueForProperty("LastBackupErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("ParentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName = (string) content.GetValueForProperty("ParentName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName, global::System.Convert.ToString); + } + if (content.Contains("ParentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType = (string) content.GetValueForProperty("ParentType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus?) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus.CreateFrom); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedItemDataSourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId = (string) content.GetValueForProperty("ProtectedItemDataSourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId, global::System.Convert.ToString); + } + if (content.Contains("ProtectedItemHealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus?) content.GetValueForProperty("ProtectedItemHealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus.CreateFrom); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureVMWorkloadSapHanaDatabaseProtectedItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LastBackupErrorDetailCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode = (string) content.GetValueForProperty("LastBackupErrorDetailCode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage = (string) content.GetValueForProperty("LastBackupErrorDetailMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailRecommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation = (string[]) content.GetValueForProperty("LastBackupErrorDetailRecommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState = (string) content.GetValueForProperty("ExtendedInfoPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetail) content.GetValueForProperty("LastBackupErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("ParentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName = (string) content.GetValueForProperty("ParentName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName, global::System.Convert.ToString); + } + if (content.Contains("ParentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType = (string) content.GetValueForProperty("ParentType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus?) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus.CreateFrom); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedItemDataSourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId = (string) content.GetValueForProperty("ProtectedItemDataSourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId, global::System.Convert.ToString); + } + if (content.Contains("ProtectedItemHealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus?) content.GetValueForProperty("ProtectedItemHealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus.CreateFrom); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapHanaDatabaseProtectedItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureVMWorkloadSapHanaDatabaseProtectedItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapHanaDatabaseProtectedItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureVMWorkloadSapHanaDatabaseProtectedItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapHanaDatabaseProtectedItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure VM workload-specific protected item representing SAP HANA Database. + [System.ComponentModel.TypeConverter(typeof(AzureVMWorkloadSapHanaDatabaseProtectedItemTypeConverter))] + public partial interface IAzureVMWorkloadSapHanaDatabaseProtectedItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapHanaDatabaseProtectedItem.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapHanaDatabaseProtectedItem.TypeConverter.cs new file mode 100644 index 000000000000..f9e8b542b184 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapHanaDatabaseProtectedItem.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureVMWorkloadSapHanaDatabaseProtectedItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapHanaDatabaseProtectedItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapHanaDatabaseProtectedItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureVMWorkloadSapHanaDatabaseProtectedItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureVMWorkloadSapHanaDatabaseProtectedItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureVMWorkloadSapHanaDatabaseProtectedItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapHanaDatabaseProtectedItem.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapHanaDatabaseProtectedItem.cs new file mode 100644 index 000000000000..5ca646ab30f5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapHanaDatabaseProtectedItem.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.Api20241115 +{ + 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.Api20241115.IAzureVMWorkloadSapHanaDatabaseProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapHanaDatabaseProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItem __azureVMWorkloadProtectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfo = value ?? null /* model class */; } + + /// The oldest backup copy available for this backup item. + [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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPoint = 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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoPolicyState = 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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoRecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).FriendlyName = value ?? null; } + + /// 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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths KpisHealth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).KpisHealth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IErrorDetail LastBackupErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for LastBackupErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailCode = value; } + + /// Internal Acessors for LastBackupErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailMessage = value; } + + /// Internal Acessors for LastBackupErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailRecommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyId = 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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemDataSourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemHealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItem + { + + } + /// Azure VM workload-specific protected item representing SAP HANA Database. + internal partial interface IAzureVMWorkloadSapHanaDatabaseProtectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapHanaDatabaseProtectedItem.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapHanaDatabaseProtectedItem.json.cs new file mode 100644 index 000000000000..8e46bcc5167b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSapHanaDatabaseProtectedItem.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.AzureVMWorkloadProtectedItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapHanaDatabaseProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSapHanaDatabaseProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSqlDatabaseProtectedItem.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSqlDatabaseProtectedItem.PowerShell.cs new file mode 100644 index 000000000000..dcb94974fe55 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSqlDatabaseProtectedItem.PowerShell.cs @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure VM workload-specific protected item representing SQL Database. + [System.ComponentModel.TypeConverter(typeof(AzureVMWorkloadSqlDatabaseProtectedItemTypeConverter))] + public partial class AzureVMWorkloadSqlDatabaseProtectedItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureVMWorkloadSqlDatabaseProtectedItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LastBackupErrorDetailCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode = (string) content.GetValueForProperty("LastBackupErrorDetailCode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage = (string) content.GetValueForProperty("LastBackupErrorDetailMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailRecommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation = (string[]) content.GetValueForProperty("LastBackupErrorDetailRecommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState = (string) content.GetValueForProperty("ExtendedInfoPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetail) content.GetValueForProperty("LastBackupErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("ParentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName = (string) content.GetValueForProperty("ParentName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName, global::System.Convert.ToString); + } + if (content.Contains("ParentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType = (string) content.GetValueForProperty("ParentType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus?) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus.CreateFrom); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedItemDataSourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId = (string) content.GetValueForProperty("ProtectedItemDataSourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId, global::System.Convert.ToString); + } + if (content.Contains("ProtectedItemHealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus?) content.GetValueForProperty("ProtectedItemHealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus.CreateFrom); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureVMWorkloadSqlDatabaseProtectedItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LastBackupErrorDetailCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode = (string) content.GetValueForProperty("LastBackupErrorDetailCode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailCode, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage = (string) content.GetValueForProperty("LastBackupErrorDetailMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailMessage, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetailRecommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation = (string[]) content.GetValueForProperty("LastBackupErrorDetailRecommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetailRecommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState = (string) content.GetValueForProperty("ExtendedInfoPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfoPolicyState, global::System.Convert.ToString); + } + if (content.Contains("LastBackupErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetail) content.GetValueForProperty("LastBackupErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("ServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName = (string) content.GetValueForProperty("ServerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ServerName, global::System.Convert.ToString); + } + if (content.Contains("ParentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName = (string) content.GetValueForProperty("ParentName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentName, global::System.Convert.ToString); + } + if (content.Contains("ParentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType = (string) content.GetValueForProperty("ParentType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ParentType, global::System.Convert.ToString); + } + if (content.Contains("ProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus = (string) content.GetValueForProperty("ProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus?) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatus.CreateFrom); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedItemDataSourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId = (string) content.GetValueForProperty("ProtectedItemDataSourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemDataSourceId, global::System.Convert.ToString); + } + if (content.Contains("ProtectedItemHealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus?) content.GetValueForProperty("ProtectedItemHealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).ProtectedItemHealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatus.CreateFrom); + } + if (content.Contains("KpisHealth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths) content.GetValueForProperty("KpisHealth",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)this).KpisHealth, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureVMWorkloadProtectedItemKpisHealthsTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSqlDatabaseProtectedItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureVMWorkloadSqlDatabaseProtectedItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSqlDatabaseProtectedItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureVMWorkloadSqlDatabaseProtectedItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSqlDatabaseProtectedItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure VM workload-specific protected item representing SQL Database. + [System.ComponentModel.TypeConverter(typeof(AzureVMWorkloadSqlDatabaseProtectedItemTypeConverter))] + public partial interface IAzureVMWorkloadSqlDatabaseProtectedItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSqlDatabaseProtectedItem.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSqlDatabaseProtectedItem.TypeConverter.cs new file mode 100644 index 000000000000..5dc3ebb0bcb6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSqlDatabaseProtectedItem.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureVMWorkloadSqlDatabaseProtectedItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSqlDatabaseProtectedItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSqlDatabaseProtectedItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureVMWorkloadSqlDatabaseProtectedItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureVMWorkloadSqlDatabaseProtectedItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureVMWorkloadSqlDatabaseProtectedItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSqlDatabaseProtectedItem.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSqlDatabaseProtectedItem.cs new file mode 100644 index 000000000000..24e4ba07bc9f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSqlDatabaseProtectedItem.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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.Api20241115.IAzureVMWorkloadSqlDatabaseProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSqlDatabaseProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItem __azureVMWorkloadProtectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfo = value ?? null /* model class */; } + + /// The oldest backup copy available for this backup item. + [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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoOldestRecoveryPoint = 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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoPolicyState = 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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ExtendedInfoRecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).FriendlyName = value ?? null; } + + /// 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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemKpisHealths KpisHealth { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).KpisHealth; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IErrorDetail LastBackupErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for LastBackupErrorDetailCode + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailCode = value; } + + /// Internal Acessors for LastBackupErrorDetailMessage + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailMessage = value; } + + /// Internal Acessors for LastBackupErrorDetailRecommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal.LastBackupErrorDetailRecommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).LastBackupErrorDetailRecommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ParentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).PolicyId = 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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemDataSourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectedItemHealthStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ProtectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItemInternal)__azureVMWorkloadProtectedItem).ServerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__azureVMWorkloadProtectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureVMWorkloadProtectedItem + { + + } + /// Azure VM workload-specific protected item representing SQL Database. + internal partial interface IAzureVMWorkloadSqlDatabaseProtectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadProtectedItemInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSqlDatabaseProtectedItem.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSqlDatabaseProtectedItem.json.cs new file mode 100644 index 000000000000..a3bfa9273b15 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureVMWorkloadSqlDatabaseProtectedItem.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.AzureVMWorkloadProtectedItem(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSqlDatabaseProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureVMWorkloadSqlDatabaseProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadErrorInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadErrorInfo.PowerShell.cs new file mode 100644 index 000000000000..f77323bdb3a9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadErrorInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure storage specific error information + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadErrorInfoTypeConverter))] + public partial class AzureWorkloadErrorInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadErrorInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).ErrorCode = (int?) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).ErrorCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ErrorString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).ErrorString = (string) content.GetValueForProperty("ErrorString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).ErrorString, global::System.Convert.ToString); + } + if (content.Contains("ErrorTitle")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).ErrorTitle = (string) content.GetValueForProperty("ErrorTitle",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).ErrorTitle, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AdditionalDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).AdditionalDetail = (string) content.GetValueForProperty("AdditionalDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).AdditionalDetail, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadErrorInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).ErrorCode = (int?) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).ErrorCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ErrorString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).ErrorString = (string) content.GetValueForProperty("ErrorString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).ErrorString, global::System.Convert.ToString); + } + if (content.Contains("ErrorTitle")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).ErrorTitle = (string) content.GetValueForProperty("ErrorTitle",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).ErrorTitle, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AdditionalDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).AdditionalDetail = (string) content.GetValueForProperty("AdditionalDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfoInternal)this).AdditionalDetail, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadErrorInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadErrorInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure storage specific error information + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadErrorInfoTypeConverter))] + public partial interface IAzureWorkloadErrorInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadErrorInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadErrorInfo.TypeConverter.cs new file mode 100644 index 000000000000..5e4b05f46742 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadErrorInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadErrorInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadErrorInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadErrorInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadErrorInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadErrorInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadErrorInfo.cs new file mode 100644 index 000000000000..60ee99be7699 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure storage specific error information + public partial class AzureWorkloadErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadErrorInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadErrorInfo.json.cs new file mode 100644 index 000000000000..d767cc186807 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadErrorInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureWorkloadErrorInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJob.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJob.PowerShell.cs new file mode 100644 index 000000000000..dc2fe24dfe0c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJob.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure storage specific job. + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadJobTypeConverter))] + public partial class AzureWorkloadJob + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadJob(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).WorkloadType = (string) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).WorkloadType, global::System.Convert.ToString); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("ActionsInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ActionsInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[]) content.GetValueForProperty("ActionsInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ActionsInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction.CreateFrom)); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfo[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadErrorInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("EntityFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName = (string) content.GetValueForProperty("EntityFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActivityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId = (string) content.GetValueForProperty("ActivityId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoTasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfoTasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetails[]) content.GetValueForProperty("ExtendedInfoTasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfoTasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedInfoPropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfoPropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag) content.GetValueForProperty("ExtendedInfoPropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfoPropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoDynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfoDynamicErrorMessage = (string) content.GetValueForProperty("ExtendedInfoDynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfoDynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadJob(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).WorkloadType = (string) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).WorkloadType, global::System.Convert.ToString); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("ActionsInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ActionsInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[]) content.GetValueForProperty("ActionsInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ActionsInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction.CreateFrom)); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadErrorInfo[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadErrorInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("EntityFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName = (string) content.GetValueForProperty("EntityFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActivityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId = (string) content.GetValueForProperty("ActivityId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoTasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfoTasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetails[]) content.GetValueForProperty("ExtendedInfoTasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfoTasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedInfoPropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfoPropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag) content.GetValueForProperty("ExtendedInfoPropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfoPropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoDynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfoDynamicErrorMessage = (string) content.GetValueForProperty("ExtendedInfoDynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal)this).ExtendedInfoDynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJob DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadJob(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJob DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadJob(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJob FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure storage specific job. + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadJobTypeConverter))] + public partial interface IAzureWorkloadJob + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJob.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJob.TypeConverter.cs new file mode 100644 index 000000000000..afa6da77d4dd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJob.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadJobTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJob ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJob).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadJob.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadJob.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadJob.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJob.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJob.cs new file mode 100644 index 000000000000..97a73aeceb1c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Azure storage specific job. + public partial class AzureWorkloadJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJob, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJob __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).ActivityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).EntityFriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)__job).EntityFriendlyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadErrorInfo[] ErrorDetail { get => this._errorDetail; set => this._errorDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadJobExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoInternal)ExtendedInfo).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadJobTaskDetails[] ExtendedInfoTasksList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoInternal)ExtendedInfo).TasksList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoInternal)ExtendedInfo).TasksList = value ?? null /* arrayOf */; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureWorkloadErrorInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureWorkloadErrorInfo[] ErrorDetail { get; set; } + /// Additional information about the job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfo ExtendedInfo { get; set; } + /// Non localized error message on job execution. + string ExtendedInfoDynamicErrorMessage { get; set; } + /// Job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks for this job + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetails[] ExtendedInfoTasksList { get; set; } + /// Workload type of the job + string WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJob.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJob.json.cs new file mode 100644 index 000000000000..e36186e2ce91 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJob.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.Job(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadErrorInfo) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadErrorInfo.FromJson(__p) )) ))() : null : ErrorDetail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..4fdf40ae7076 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure VM workload-specific additional information for job. + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadJobExtendedInfoTypeConverter))] + public partial class AzureWorkloadJobExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadJobExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoInternal)this).TasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetails[]) content.GetValueForProperty("TasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoInternal)this).TasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("DynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoInternal)this).DynamicErrorMessage = (string) content.GetValueForProperty("DynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoInternal)this).DynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadJobExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoInternal)this).TasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetails[]) content.GetValueForProperty("TasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoInternal)this).TasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("DynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoInternal)this).DynamicErrorMessage = (string) content.GetValueForProperty("DynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoInternal)this).DynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadJobExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadJobExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure VM workload-specific additional information for job. + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadJobExtendedInfoTypeConverter))] + public partial interface IAzureWorkloadJobExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..5e5e5e528395 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadJobExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadJobExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadJobExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadJobExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfo.cs new file mode 100644 index 000000000000..0820230b5fd4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IAzureWorkloadJobExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag _propertyBag; + + /// Job properties. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag PropertyBag { get => (this._propertyBag = this._propertyBag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobExtendedInfoPropertyBag()); set => this._propertyBag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag PropertyBag { get; set; } + /// List of tasks for this job + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetails[] TasksList { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfo.json.cs new file mode 100644 index 000000000000..5f5ac2e732d2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureWorkloadJobTaskDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadJobTaskDetails.FromJson(__u) )) ))() : null : TasksList;} + {_propertyBag = If( json?.PropertyT("propertyBag"), out var __jsonPropertyBag) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadJobExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfoPropertyBag.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfoPropertyBag.PowerShell.cs new file mode 100644 index 000000000000..9b6babe450d3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfoPropertyBag.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Job properties. + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadJobExtendedInfoPropertyBagTypeConverter))] + public partial class AzureWorkloadJobExtendedInfoPropertyBag + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadJobExtendedInfoPropertyBag(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadJobExtendedInfoPropertyBag(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadJobExtendedInfoPropertyBag(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadJobExtendedInfoPropertyBag(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Job properties. + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadJobExtendedInfoPropertyBagTypeConverter))] + public partial interface IAzureWorkloadJobExtendedInfoPropertyBag + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfoPropertyBag.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfoPropertyBag.TypeConverter.cs new file mode 100644 index 000000000000..5a57c6b808cd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfoPropertyBag.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadJobExtendedInfoPropertyBagTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadJobExtendedInfoPropertyBag.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadJobExtendedInfoPropertyBag.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadJobExtendedInfoPropertyBag.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfoPropertyBag.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfoPropertyBag.cs new file mode 100644 index 000000000000..0cc64d8f3004 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Job properties. + public partial class AzureWorkloadJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfoPropertyBag.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfoPropertyBag.dictionary.cs new file mode 100644 index 000000000000..702a4a914804 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.AzureWorkloadJobExtendedInfoPropertyBag source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfoPropertyBag.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfoPropertyBag.json.cs new file mode 100644 index 000000000000..f955169e6acb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobExtendedInfoPropertyBag.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobExtendedInfoPropertyBag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobTaskDetails.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobTaskDetails.PowerShell.cs new file mode 100644 index 000000000000..b947b23ae966 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobTaskDetails.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Azure VM workload specific job task details. + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadJobTaskDetailsTypeConverter))] + public partial class AzureWorkloadJobTaskDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadJobTaskDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetailsInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetailsInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetailsInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetailsInternal)this).Status, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadJobTaskDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetailsInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetailsInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetailsInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetailsInternal)this).Status, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadJobTaskDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadJobTaskDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure VM workload specific job task details. + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadJobTaskDetailsTypeConverter))] + public partial interface IAzureWorkloadJobTaskDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobTaskDetails.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobTaskDetails.TypeConverter.cs new file mode 100644 index 000000000000..803be8f6ac42 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobTaskDetails.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadJobTaskDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadJobTaskDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadJobTaskDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadJobTaskDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobTaskDetails.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobTaskDetails.cs new file mode 100644 index 000000000000..2614d475714b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IAzureWorkloadJobTaskDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobTaskDetails.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobTaskDetails.json.cs new file mode 100644 index 000000000000..6393990305ad --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadJobTaskDetails.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureWorkloadJobTaskDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadJobTaskDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRecoveryPoint.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRecoveryPoint.PowerShell.cs new file mode 100644 index 000000000000..39ca085397c6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRecoveryPoint.PowerShell.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Recovery point specific to PointInTime + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadPointInTimeRecoveryPointTypeConverter))] + public partial class AzureWorkloadPointInTimeRecoveryPoint + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadPointInTimeRecoveryPoint(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimeRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPointInternal)this).TimeRange = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange[]) content.GetValueForProperty("TimeRange",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPointInternal)this).TimeRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.PointInTimeRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType.CreateFrom); + } + if (content.Contains("RecoveryPointTierDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[]) content.GetValueForProperty("RecoveryPointTierDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointMoveReadinessInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo) content.GetValueForProperty("RecoveryPointMoveReadinessInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPointMoveReadinessInfoTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadPointInTimeRecoveryPoint(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimeRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPointInternal)this).TimeRange = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange[]) content.GetValueForProperty("TimeRange",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPointInternal)this).TimeRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.PointInTimeRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType.CreateFrom); + } + if (content.Contains("RecoveryPointTierDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[]) content.GetValueForProperty("RecoveryPointTierDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointMoveReadinessInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo) content.GetValueForProperty("RecoveryPointMoveReadinessInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPointMoveReadinessInfoTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadPointInTimeRecoveryPoint(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadPointInTimeRecoveryPoint(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Recovery point specific to PointInTime + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadPointInTimeRecoveryPointTypeConverter))] + public partial interface IAzureWorkloadPointInTimeRecoveryPoint + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRecoveryPoint.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRecoveryPoint.TypeConverter.cs new file mode 100644 index 000000000000..7c0679969ded --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRecoveryPoint.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadPointInTimeRecoveryPointTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPoint ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPoint).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadPointInTimeRecoveryPoint.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadPointInTimeRecoveryPoint.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadPointInTimeRecoveryPoint.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRecoveryPoint.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRecoveryPoint.cs new file mode 100644 index 000000000000..b5b66c43ac3d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRecoveryPoint.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point specific to PointInTime + public partial class AzureWorkloadPointInTimeRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPoint __azureWorkloadRecoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPoint(); + + /// Internal Acessors for RecoveryPointTimeInUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal.RecoveryPointTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTimeInUtc = value; } + + /// Internal Acessors for Type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).Type = 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.Api20241115.IRecoveryPointInternal)__azureWorkloadRecoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointMoveReadinessInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointMoveReadinessInfo = value ?? null /* model class */; } + + /// Properties of Recovery Point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties RecoveryPointProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointProperty = value ?? null /* model class */; } + + /// Expiry time of Recovery Point in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RecoveryPointPropertyExpiryTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyExpiryTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyExpiryTime = value ?? null; } + + /// Bool to indicate whether RP is in soft delete state or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? RecoveryPointPropertyIsSoftDeleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyIsSoftDeleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyIsSoftDeleted = value ?? default(bool); } + + /// Rule name tagged on Recovery Point that governs life cycle + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RecoveryPointPropertyRuleName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyRuleName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyRuleName = value ?? null; } + + /// Recovery point tier information. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[] RecoveryPointTierDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTierDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTimeInUtc; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).Type; } + + /// 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.Api20241115.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.Api20241115.IPointInTimeRange) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange[] TimeRange { get; set; } + + } + /// Recovery point specific to PointInTime + internal partial interface IAzureWorkloadPointInTimeRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal + { + /// List of log ranges + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange[] TimeRange { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRecoveryPoint.json.cs new file mode 100644 index 000000000000..dd52b0ded868 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRecoveryPoint.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.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.Api20241115.IPointInTimeRange) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.PointInTimeRange.FromJson(__u) )) ))() : null : TimeRange;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPoint. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadPointInTimeRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRestoreRequest.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRestoreRequest.PowerShell.cs new file mode 100644 index 000000000000..f3ac3f95732a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRestoreRequest.PowerShell.cs @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore + /// + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadPointInTimeRestoreRequestTypeConverter))] + public partial class AzureWorkloadPointInTimeRestoreRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadPointInTimeRestoreRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PointInTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRestoreRequestInternal)this).PointInTime = (global::System.DateTime?) content.GetValueForProperty("PointInTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRestoreRequestInternal)this).PointInTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions?) content.GetValueForProperty("TargetInfoOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions.CreateFrom); + } + if (content.Contains("TargetInfoContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId = (string) content.GetValueForProperty("TargetInfoContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName = (string) content.GetValueForProperty("TargetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoTargetDirectoryForFileRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore = (string) content.GetValueForProperty("TargetInfoTargetDirectoryForFileRestore",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore, global::System.Convert.ToString); + } + if (content.Contains("TargetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo) content.GetValueForProperty("TargetInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetRestoreInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequestPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode?) content.GetValueForProperty("RecoveryMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode.CreateFrom); + } + if (content.Contains("TargetVirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId = (string) content.GetValueForProperty("TargetVirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadPointInTimeRestoreRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PointInTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRestoreRequestInternal)this).PointInTime = (global::System.DateTime?) content.GetValueForProperty("PointInTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRestoreRequestInternal)this).PointInTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions?) content.GetValueForProperty("TargetInfoOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions.CreateFrom); + } + if (content.Contains("TargetInfoContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId = (string) content.GetValueForProperty("TargetInfoContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName = (string) content.GetValueForProperty("TargetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoTargetDirectoryForFileRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore = (string) content.GetValueForProperty("TargetInfoTargetDirectoryForFileRestore",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore, global::System.Convert.ToString); + } + if (content.Contains("TargetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo) content.GetValueForProperty("TargetInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetRestoreInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequestPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode?) content.GetValueForProperty("RecoveryMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode.CreateFrom); + } + if (content.Contains("TargetVirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId = (string) content.GetValueForProperty("TargetVirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRestoreRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadPointInTimeRestoreRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRestoreRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadPointInTimeRestoreRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRestoreRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadPointInTimeRestoreRequestTypeConverter))] + public partial interface IAzureWorkloadPointInTimeRestoreRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRestoreRequest.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRestoreRequest.TypeConverter.cs new file mode 100644 index 000000000000..c1b005e68e32 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRestoreRequest.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadPointInTimeRestoreRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRestoreRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRestoreRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadPointInTimeRestoreRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadPointInTimeRestoreRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadPointInTimeRestoreRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRestoreRequest.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRestoreRequest.cs new file mode 100644 index 000000000000..1526d8703e26 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IAzureWorkloadPointInTimeRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequest __azureWorkloadRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRestoreRequestInternal)__azureWorkloadRestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ITargetRestoreInfo TargetInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoTargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetVirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal + { + /// PointInTime value + global::System.DateTime? PointInTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRestoreRequest.json.cs new file mode 100644 index 000000000000..145670cea583 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadPointInTimeRestoreRequest.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.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.Api20241115.IAzureWorkloadPointInTimeRestoreRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPoint.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPoint.PowerShell.cs new file mode 100644 index 000000000000..08a23da75582 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPoint.PowerShell.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// Workload specific recovery point, specifically encapsulates full/diff recovery point + /// + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadRecoveryPointTypeConverter))] + public partial class AzureWorkloadRecoveryPoint + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadRecoveryPoint(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType.CreateFrom); + } + if (content.Contains("RecoveryPointTierDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[]) content.GetValueForProperty("RecoveryPointTierDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointMoveReadinessInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo) content.GetValueForProperty("RecoveryPointMoveReadinessInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPointMoveReadinessInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadRecoveryPoint(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType.CreateFrom); + } + if (content.Contains("RecoveryPointTierDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[]) content.GetValueForProperty("RecoveryPointTierDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointMoveReadinessInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo) content.GetValueForProperty("RecoveryPointMoveReadinessInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPointMoveReadinessInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadRecoveryPoint(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadRecoveryPoint(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Workload specific recovery point, specifically encapsulates full/diff recovery point + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadRecoveryPointTypeConverter))] + public partial interface IAzureWorkloadRecoveryPoint + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPoint.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPoint.TypeConverter.cs new file mode 100644 index 000000000000..33a077d0d94c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPoint.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadRecoveryPointTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPoint ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPoint).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadRecoveryPoint.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadRecoveryPoint.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadRecoveryPoint.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPoint.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPoint.cs new file mode 100644 index 000000000000..d9d419f29cc7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPoint.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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.Api20241115.IAzureWorkloadRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint __recoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPoint(); + + /// Internal Acessors for RecoveryPointProperty + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal.RecoveryPointProperty { get => (this._recoveryPointProperty = this._recoveryPointProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointProperties()); set { {_recoveryPointProperty = value;} } } + + /// Internal Acessors for RecoveryPointTimeInUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal.RecoveryPointTimeInUtc { get => this._recoveryPointTimeInUtc; set { {_recoveryPointTimeInUtc = value;} } } + + /// Internal Acessors for Type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal.Type { get => this._type; set { {_type = 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.Api20241115.IRecoveryPointInternal)__recoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)__recoveryPoint).ObjectType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get => (this._recoveryPointMoveReadinessInfo = this._recoveryPointMoveReadinessInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPointMoveReadinessInfo()); set => this._recoveryPointMoveReadinessInfo = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties _recoveryPointProperty; + + /// Properties of Recovery Point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties RecoveryPointProperty { get => (this._recoveryPointProperty = this._recoveryPointProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointProperties()); set => this._recoveryPointProperty = value; } + + /// Expiry time of Recovery Point in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RecoveryPointPropertyExpiryTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).ExpiryTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).ExpiryTime = value ?? null; } + + /// Bool to indicate whether RP is in soft delete state or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? RecoveryPointPropertyIsSoftDeleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).IsSoftDeleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).IsSoftDeleted = value ?? default(bool); } + + /// Rule name tagged on Recovery Point that governs life cycle + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RecoveryPointPropertyRuleName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).RuleName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).RuleName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[] _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.Api20241115.IRecoveryPointTierInformation[] 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; } + + /// 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; } + + /// 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.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get; set; } + /// Expiry time of Recovery Point in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiry time of Recovery Point in UTC.", + SerializedName = @"expiryTime", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointPropertyExpiryTime { get; set; } + /// Bool to indicate whether RP is in soft delete state or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Bool to indicate whether RP is in soft delete state or not", + SerializedName = @"isSoftDeleted", + PossibleTypes = new [] { typeof(bool) })] + bool? RecoveryPointPropertyIsSoftDeleted { get; set; } + /// Rule name tagged on Recovery Point that governs life cycle + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rule name tagged on Recovery Point that governs life cycle", + SerializedName = @"ruleName", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointPropertyRuleName { 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.Api20241115.IRecoveryPointTierInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[] RecoveryPointTierDetail { get; set; } + /// UTC time at which recovery point was created + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"UTC time at which recovery point was created", + SerializedName = @"recoveryPointTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RecoveryPointTimeInUtc { get; } + /// Type of restore point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + 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; } + + } + /// Workload specific recovery point, specifically encapsulates full/diff recovery point + internal partial interface IAzureWorkloadRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal + { + /// Eligibility of RP to be moved to another tier + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get; set; } + /// Properties of Recovery Point + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties RecoveryPointProperty { get; set; } + /// Expiry time of Recovery Point in UTC. + string RecoveryPointPropertyExpiryTime { get; set; } + /// Bool to indicate whether RP is in soft delete state or not + bool? RecoveryPointPropertyIsSoftDeleted { get; set; } + /// Rule name tagged on Recovery Point that governs life cycle + string RecoveryPointPropertyRuleName { get; set; } + /// Recovery point tier information. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[] 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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPoint.json.cs new file mode 100644 index 000000000000..11bb3b13490a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPoint.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.RecoveryPoint(json); + {_recoveryPointProperty = If( json?.PropertyT("recoveryPointProperties"), out var __jsonRecoveryPointProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointProperties.FromJson(__jsonRecoveryPointProperties) : RecoveryPointProperty;} + {_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.Api20241115.IRecoveryPointTierInformation) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformation.FromJson(__u) )) ))() : null : RecoveryPointTierDetail;} + {_recoveryPointMoveReadinessInfo = If( json?.PropertyT("recoveryPointMoveReadinessInfo"), out var __jsonRecoveryPointMoveReadinessInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPointMoveReadinessInfo.FromJson(__jsonRecoveryPointMoveReadinessInfo) : RecoveryPointMoveReadinessInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPoint. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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._recoveryPointProperty ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._recoveryPointProperty.ToJson(null,serializationMode) : null, "recoveryPointProperties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + 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 ); + } + 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 (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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPointMoveReadinessInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPointMoveReadinessInfo.PowerShell.cs new file mode 100644 index 000000000000..fe303ee190f5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPointMoveReadinessInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Eligibility of RP to be moved to another tier + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadRecoveryPointMoveReadinessInfoTypeConverter))] + public partial class AzureWorkloadRecoveryPointMoveReadinessInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadRecoveryPointMoveReadinessInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadRecoveryPointMoveReadinessInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadRecoveryPointMoveReadinessInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadRecoveryPointMoveReadinessInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Eligibility of RP to be moved to another tier + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadRecoveryPointMoveReadinessInfoTypeConverter))] + public partial interface IAzureWorkloadRecoveryPointMoveReadinessInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPointMoveReadinessInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPointMoveReadinessInfo.TypeConverter.cs new file mode 100644 index 000000000000..875a1335ae89 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPointMoveReadinessInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadRecoveryPointMoveReadinessInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadRecoveryPointMoveReadinessInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadRecoveryPointMoveReadinessInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadRecoveryPointMoveReadinessInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPointMoveReadinessInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPointMoveReadinessInfo.cs new file mode 100644 index 000000000000..73d17979568a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPointMoveReadinessInfo.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPointMoveReadinessInfo.dictionary.cs new file mode 100644 index 000000000000..98dd9a1d8dd4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.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.Api20241115.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.Api20241115.IRecoveryPointMoveReadinessInfo value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPointMoveReadinessInfo source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPointMoveReadinessInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPointMoveReadinessInfo.json.cs new file mode 100644 index 000000000000..ac42481f6561 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRecoveryPointMoveReadinessInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.RecoveryPointMoveReadinessInfo.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequest.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequest.PowerShell.cs new file mode 100644 index 000000000000..d0de2f4ebb1b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequest.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// AzureWorkload-specific restore. + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadRestoreRequestTypeConverter))] + public partial class AzureWorkloadRestoreRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadRestoreRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo) content.GetValueForProperty("TargetInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetRestoreInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequestPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode?) content.GetValueForProperty("RecoveryMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode.CreateFrom); + } + if (content.Contains("TargetVirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId = (string) content.GetValueForProperty("TargetVirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions?) content.GetValueForProperty("TargetInfoOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions.CreateFrom); + } + if (content.Contains("TargetInfoContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId = (string) content.GetValueForProperty("TargetInfoContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName = (string) content.GetValueForProperty("TargetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoTargetDirectoryForFileRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore = (string) content.GetValueForProperty("TargetInfoTargetDirectoryForFileRestore",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadRestoreRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo) content.GetValueForProperty("TargetInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetRestoreInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequestPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode?) content.GetValueForProperty("RecoveryMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode.CreateFrom); + } + if (content.Contains("TargetVirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId = (string) content.GetValueForProperty("TargetVirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions?) content.GetValueForProperty("TargetInfoOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions.CreateFrom); + } + if (content.Contains("TargetInfoContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId = (string) content.GetValueForProperty("TargetInfoContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName = (string) content.GetValueForProperty("TargetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoTargetDirectoryForFileRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore = (string) content.GetValueForProperty("TargetInfoTargetDirectoryForFileRestore",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadRestoreRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadRestoreRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// AzureWorkload-specific restore. + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadRestoreRequestTypeConverter))] + public partial interface IAzureWorkloadRestoreRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequest.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequest.TypeConverter.cs new file mode 100644 index 000000000000..df2af79af7fa --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequest.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadRestoreRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadRestoreRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadRestoreRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadRestoreRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequest.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequest.cs new file mode 100644 index 000000000000..cbe2f87a02c3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureWorkload-specific restore. + public partial class AzureWorkloadRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest __restoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RestoreRequest(); + + /// Internal Acessors for TargetInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal.TargetInfo { get => (this._targetInfo = this._targetInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRestoreRequestInternal)__restoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)__restoreRequest).ObjectType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => (this._propertyBag = this._propertyBag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.ITargetRestoreInfo TargetInfo { get => (this._targetInfo = this._targetInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ITargetRestoreInfoInternal)TargetInfo).ContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ITargetRestoreInfoInternal)TargetInfo).DatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ITargetRestoreInfoInternal)TargetInfo).OverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ITargetRestoreInfoInternal)TargetInfo).TargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRestoreRequestInternal + { + /// Workload specific property bag. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequest.json.cs new file mode 100644 index 000000000000..cda6342c3e20 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequest.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.RestoreRequest(json); + {_targetInfo = If( json?.PropertyT("targetInfo"), out var __jsonTargetInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequest. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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); + } + } + 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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequestPropertyBag.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequestPropertyBag.PowerShell.cs new file mode 100644 index 000000000000..34ffe73cd8ac --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequestPropertyBag.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Workload specific property bag. + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadRestoreRequestPropertyBagTypeConverter))] + public partial class AzureWorkloadRestoreRequestPropertyBag + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadRestoreRequestPropertyBag(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadRestoreRequestPropertyBag(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadRestoreRequestPropertyBag(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadRestoreRequestPropertyBag(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Workload specific property bag. + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadRestoreRequestPropertyBagTypeConverter))] + public partial interface IAzureWorkloadRestoreRequestPropertyBag + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequestPropertyBag.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequestPropertyBag.TypeConverter.cs new file mode 100644 index 000000000000..1720589f9507 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequestPropertyBag.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadRestoreRequestPropertyBagTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadRestoreRequestPropertyBag.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadRestoreRequestPropertyBag.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadRestoreRequestPropertyBag.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequestPropertyBag.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequestPropertyBag.cs new file mode 100644 index 000000000000..9c1d2c7a0d33 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Workload specific property bag. + public partial class AzureWorkloadRestoreRequestPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequestPropertyBag.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequestPropertyBag.dictionary.cs new file mode 100644 index 000000000000..40e026e531ea --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.AzureWorkloadRestoreRequestPropertyBag source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequestPropertyBag.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequestPropertyBag.json.cs new file mode 100644 index 000000000000..fa0078ebe186 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadRestoreRequestPropertyBag.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IAzureWorkloadRestoreRequestPropertyBag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRecoveryPoint.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRecoveryPoint.PowerShell.cs new file mode 100644 index 000000000000..fac02bf61a14 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRecoveryPoint.PowerShell.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Recovery point specific to PointInTime in SAPHana + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSapHanaPointInTimeRecoveryPointTypeConverter))] + public partial class AzureWorkloadSapHanaPointInTimeRecoveryPoint + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadSapHanaPointInTimeRecoveryPoint(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType.CreateFrom); + } + if (content.Contains("RecoveryPointTierDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[]) content.GetValueForProperty("RecoveryPointTierDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointMoveReadinessInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo) content.GetValueForProperty("RecoveryPointMoveReadinessInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPointMoveReadinessInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TimeRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPointInternal)this).TimeRange = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange[]) content.GetValueForProperty("TimeRange",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPointInternal)this).TimeRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.PointInTimeRangeTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadSapHanaPointInTimeRecoveryPoint(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType.CreateFrom); + } + if (content.Contains("RecoveryPointTierDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[]) content.GetValueForProperty("RecoveryPointTierDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointMoveReadinessInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo) content.GetValueForProperty("RecoveryPointMoveReadinessInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPointMoveReadinessInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TimeRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPointInternal)this).TimeRange = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange[]) content.GetValueForProperty("TimeRange",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPointInternal)this).TimeRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.PointInTimeRangeTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRecoveryPoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadSapHanaPointInTimeRecoveryPoint(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRecoveryPoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadSapHanaPointInTimeRecoveryPoint(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRecoveryPoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Recovery point specific to PointInTime in SAPHana + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSapHanaPointInTimeRecoveryPointTypeConverter))] + public partial interface IAzureWorkloadSapHanaPointInTimeRecoveryPoint + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRecoveryPoint.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRecoveryPoint.TypeConverter.cs new file mode 100644 index 000000000000..20f242343489 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRecoveryPoint.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadSapHanaPointInTimeRecoveryPointTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRecoveryPoint ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRecoveryPoint).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadSapHanaPointInTimeRecoveryPoint.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadSapHanaPointInTimeRecoveryPoint.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadSapHanaPointInTimeRecoveryPoint.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRecoveryPoint.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRecoveryPoint.cs new file mode 100644 index 000000000000..479fc34f119c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRecoveryPoint.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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.Api20241115.IAzureWorkloadSapHanaPointInTimeRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPoint __azureWorkloadPointInTimeRecoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadPointInTimeRecoveryPoint(); + + /// Internal Acessors for RecoveryPointTimeInUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal.RecoveryPointTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointTimeInUtc = value; } + + /// Internal Acessors for Type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).Type = 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.Api20241115.IRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointMoveReadinessInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointMoveReadinessInfo = value ?? null /* model class */; } + + /// Properties of Recovery Point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties RecoveryPointProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointProperty = value ?? null /* model class */; } + + /// Expiry time of Recovery Point in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RecoveryPointPropertyExpiryTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointPropertyExpiryTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointPropertyExpiryTime = value ?? null; } + + /// Bool to indicate whether RP is in soft delete state or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? RecoveryPointPropertyIsSoftDeleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointPropertyIsSoftDeleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointPropertyIsSoftDeleted = value ?? default(bool); } + + /// Rule name tagged on Recovery Point that governs life cycle + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RecoveryPointPropertyRuleName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointPropertyRuleName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointPropertyRuleName = value ?? null; } + + /// Recovery point tier information. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[] RecoveryPointTierDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointTierDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).RecoveryPointTimeInUtc; } + + /// List of log ranges + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange[] TimeRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).TimeRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadPointInTimeRecoveryPoint).Type; } + + /// + /// 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.Api20241115.IAzureWorkloadPointInTimeRecoveryPoint + { + + } + /// Recovery point specific to PointInTime in SAPHana + internal partial interface IAzureWorkloadSapHanaPointInTimeRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadPointInTimeRecoveryPointInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRecoveryPoint.json.cs new file mode 100644 index 000000000000..6227ec49ec3b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRecoveryPoint.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.AzureWorkloadPointInTimeRecoveryPoint(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRecoveryPoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRestoreRequest.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRestoreRequest.PowerShell.cs new file mode 100644 index 000000000000..e02627cc9ea7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRestoreRequest.PowerShell.cs @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore + /// + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSapHanaPointInTimeRestoreRequestTypeConverter))] + public partial class AzureWorkloadSapHanaPointInTimeRestoreRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadSapHanaPointInTimeRestoreRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PointInTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRestoreRequestInternal)this).PointInTime = (global::System.DateTime?) content.GetValueForProperty("PointInTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRestoreRequestInternal)this).PointInTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions?) content.GetValueForProperty("TargetInfoOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions.CreateFrom); + } + if (content.Contains("TargetInfoContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId = (string) content.GetValueForProperty("TargetInfoContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName = (string) content.GetValueForProperty("TargetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoTargetDirectoryForFileRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore = (string) content.GetValueForProperty("TargetInfoTargetDirectoryForFileRestore",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore, global::System.Convert.ToString); + } + if (content.Contains("TargetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo) content.GetValueForProperty("TargetInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetRestoreInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequestPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode?) content.GetValueForProperty("RecoveryMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode.CreateFrom); + } + if (content.Contains("TargetVirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId = (string) content.GetValueForProperty("TargetVirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadSapHanaPointInTimeRestoreRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PointInTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRestoreRequestInternal)this).PointInTime = (global::System.DateTime?) content.GetValueForProperty("PointInTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRestoreRequestInternal)this).PointInTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions?) content.GetValueForProperty("TargetInfoOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions.CreateFrom); + } + if (content.Contains("TargetInfoContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId = (string) content.GetValueForProperty("TargetInfoContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName = (string) content.GetValueForProperty("TargetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoTargetDirectoryForFileRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore = (string) content.GetValueForProperty("TargetInfoTargetDirectoryForFileRestore",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore, global::System.Convert.ToString); + } + if (content.Contains("TargetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo) content.GetValueForProperty("TargetInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetRestoreInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequestPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode?) content.GetValueForProperty("RecoveryMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode.CreateFrom); + } + if (content.Contains("TargetVirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId = (string) content.GetValueForProperty("TargetVirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRestoreRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadSapHanaPointInTimeRestoreRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRestoreRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadSapHanaPointInTimeRestoreRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRestoreRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSapHanaPointInTimeRestoreRequestTypeConverter))] + public partial interface IAzureWorkloadSapHanaPointInTimeRestoreRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRestoreRequest.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRestoreRequest.TypeConverter.cs new file mode 100644 index 000000000000..73010b74e9db --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRestoreRequest.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadSapHanaPointInTimeRestoreRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRestoreRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRestoreRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadSapHanaPointInTimeRestoreRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadSapHanaPointInTimeRestoreRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadSapHanaPointInTimeRestoreRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRestoreRequest.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRestoreRequest.cs new file mode 100644 index 000000000000..d7ade8f75711 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IAzureWorkloadSapHanaPointInTimeRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequest __azureWorkloadRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRestoreRequestInternal)__azureWorkloadRestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ITargetRestoreInfo TargetInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoTargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetVirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal + { + /// PointInTime value + global::System.DateTime? PointInTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRestoreRequest.json.cs new file mode 100644 index 000000000000..f5110624f379 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaPointInTimeRestoreRequest.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.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.Api20241115.IAzureWorkloadSapHanaPointInTimeRestoreRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaPointInTimeRestoreRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadSapHanaPointInTimeRestoreRequest(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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRecoveryPoint.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRecoveryPoint.PowerShell.cs new file mode 100644 index 000000000000..b5ef9b433112 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRecoveryPoint.PowerShell.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints + /// + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSapHanaRecoveryPointTypeConverter))] + public partial class AzureWorkloadSapHanaRecoveryPoint + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadSapHanaRecoveryPoint(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType.CreateFrom); + } + if (content.Contains("RecoveryPointTierDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[]) content.GetValueForProperty("RecoveryPointTierDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointMoveReadinessInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo) content.GetValueForProperty("RecoveryPointMoveReadinessInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPointMoveReadinessInfoTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadSapHanaRecoveryPoint(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType.CreateFrom); + } + if (content.Contains("RecoveryPointTierDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[]) content.GetValueForProperty("RecoveryPointTierDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointMoveReadinessInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo) content.GetValueForProperty("RecoveryPointMoveReadinessInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPointMoveReadinessInfoTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRecoveryPoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadSapHanaRecoveryPoint(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRecoveryPoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadSapHanaRecoveryPoint(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRecoveryPoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSapHanaRecoveryPointTypeConverter))] + public partial interface IAzureWorkloadSapHanaRecoveryPoint + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRecoveryPoint.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRecoveryPoint.TypeConverter.cs new file mode 100644 index 000000000000..dae4d91f1a6e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRecoveryPoint.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadSapHanaRecoveryPointTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRecoveryPoint ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRecoveryPoint).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadSapHanaRecoveryPoint.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadSapHanaRecoveryPoint.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadSapHanaRecoveryPoint.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRecoveryPoint.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRecoveryPoint.cs new file mode 100644 index 000000000000..dd1971f7fa0f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRecoveryPoint.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.Api20241115 +{ + 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.Api20241115.IAzureWorkloadSapHanaRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPoint __azureWorkloadRecoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPoint(); + + /// Internal Acessors for RecoveryPointTimeInUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal.RecoveryPointTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTimeInUtc = value; } + + /// Internal Acessors for Type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).Type = 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.Api20241115.IRecoveryPointInternal)__azureWorkloadRecoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointMoveReadinessInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointMoveReadinessInfo = value ?? null /* model class */; } + + /// Properties of Recovery Point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties RecoveryPointProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointProperty = value ?? null /* model class */; } + + /// Expiry time of Recovery Point in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RecoveryPointPropertyExpiryTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyExpiryTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyExpiryTime = value ?? null; } + + /// Bool to indicate whether RP is in soft delete state or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? RecoveryPointPropertyIsSoftDeleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyIsSoftDeleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyIsSoftDeleted = value ?? default(bool); } + + /// Rule name tagged on Recovery Point that governs life cycle + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RecoveryPointPropertyRuleName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyRuleName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyRuleName = value ?? null; } + + /// Recovery point tier information. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[] RecoveryPointTierDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTierDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTimeInUtc; } + + /// 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.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).Type; } + + /// 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.Api20241115.IAzureWorkloadRecoveryPoint + { + + } + /// SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints + internal partial interface IAzureWorkloadSapHanaRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRecoveryPoint.json.cs new file mode 100644 index 000000000000..6455db7115cf --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRecoveryPoint.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.AzureWorkloadRecoveryPoint(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRecoveryPoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRestoreRequest.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRestoreRequest.PowerShell.cs new file mode 100644 index 000000000000..b7d8b55333f9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRestoreRequest.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// AzureWorkload SAP Hana-specific restore. + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSapHanaRestoreRequestTypeConverter))] + public partial class AzureWorkloadSapHanaRestoreRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadSapHanaRestoreRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions?) content.GetValueForProperty("TargetInfoOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions.CreateFrom); + } + if (content.Contains("TargetInfoContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId = (string) content.GetValueForProperty("TargetInfoContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName = (string) content.GetValueForProperty("TargetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoTargetDirectoryForFileRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore = (string) content.GetValueForProperty("TargetInfoTargetDirectoryForFileRestore",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore, global::System.Convert.ToString); + } + if (content.Contains("TargetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo) content.GetValueForProperty("TargetInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetRestoreInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequestPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode?) content.GetValueForProperty("RecoveryMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode.CreateFrom); + } + if (content.Contains("TargetVirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId = (string) content.GetValueForProperty("TargetVirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadSapHanaRestoreRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions?) content.GetValueForProperty("TargetInfoOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions.CreateFrom); + } + if (content.Contains("TargetInfoContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId = (string) content.GetValueForProperty("TargetInfoContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName = (string) content.GetValueForProperty("TargetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoTargetDirectoryForFileRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore = (string) content.GetValueForProperty("TargetInfoTargetDirectoryForFileRestore",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore, global::System.Convert.ToString); + } + if (content.Contains("TargetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo) content.GetValueForProperty("TargetInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetRestoreInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequestPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode?) content.GetValueForProperty("RecoveryMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode.CreateFrom); + } + if (content.Contains("TargetVirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId = (string) content.GetValueForProperty("TargetVirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRestoreRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadSapHanaRestoreRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRestoreRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadSapHanaRestoreRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRestoreRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// AzureWorkload SAP Hana-specific restore. + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSapHanaRestoreRequestTypeConverter))] + public partial interface IAzureWorkloadSapHanaRestoreRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRestoreRequest.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRestoreRequest.TypeConverter.cs new file mode 100644 index 000000000000..9c887576d3d6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRestoreRequest.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadSapHanaRestoreRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRestoreRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRestoreRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadSapHanaRestoreRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadSapHanaRestoreRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadSapHanaRestoreRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRestoreRequest.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRestoreRequest.cs new file mode 100644 index 000000000000..5b3b6506c44d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// AzureWorkload SAP Hana-specific restore. + public partial class AzureWorkloadSapHanaRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequest __azureWorkloadRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRestoreRequestInternal)__azureWorkloadRestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ITargetRestoreInfo TargetInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoTargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetVirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequest + { + + } + /// AzureWorkload SAP Hana-specific restore. + internal partial interface IAzureWorkloadSapHanaRestoreRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRestoreRequest.json.cs new file mode 100644 index 000000000000..234fcdba7293 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSapHanaRestoreRequest.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.AzureWorkloadRestoreRequest(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRestoreRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSapHanaRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRecoveryPoint.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRecoveryPoint.PowerShell.cs new file mode 100644 index 000000000000..3cfd52c7e008 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRecoveryPoint.PowerShell.cs @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Recovery point specific to PointInTime + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSqlPointInTimeRecoveryPointTypeConverter))] + public partial class AzureWorkloadSqlPointInTimeRecoveryPoint + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadSqlPointInTimeRecoveryPoint(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimeRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRecoveryPointInternal)this).TimeRange = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange[]) content.GetValueForProperty("TimeRange",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRecoveryPointInternal)this).TimeRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.PointInTimeRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType.CreateFrom); + } + if (content.Contains("RecoveryPointTierDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[]) content.GetValueForProperty("RecoveryPointTierDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointMoveReadinessInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo) content.GetValueForProperty("RecoveryPointMoveReadinessInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPointMoveReadinessInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoDataDirectoryTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoDataDirectoryTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoDataDirectoryPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryPath = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory[]) content.GetValueForProperty("ExtendedInfoDataDirectoryPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryPath, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectoryTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlRecoveryPointExtendedInfoTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadSqlPointInTimeRecoveryPoint(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimeRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRecoveryPointInternal)this).TimeRange = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange[]) content.GetValueForProperty("TimeRange",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRecoveryPointInternal)this).TimeRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.PointInTimeRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType.CreateFrom); + } + if (content.Contains("RecoveryPointTierDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[]) content.GetValueForProperty("RecoveryPointTierDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointMoveReadinessInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo) content.GetValueForProperty("RecoveryPointMoveReadinessInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPointMoveReadinessInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoDataDirectoryTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoDataDirectoryTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoDataDirectoryPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryPath = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory[]) content.GetValueForProperty("ExtendedInfoDataDirectoryPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryPath, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectoryTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlRecoveryPointExtendedInfoTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRecoveryPoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadSqlPointInTimeRecoveryPoint(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRecoveryPoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadSqlPointInTimeRecoveryPoint(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRecoveryPoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Recovery point specific to PointInTime + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSqlPointInTimeRecoveryPointTypeConverter))] + public partial interface IAzureWorkloadSqlPointInTimeRecoveryPoint + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRecoveryPoint.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRecoveryPoint.TypeConverter.cs new file mode 100644 index 000000000000..0b3d054f612c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRecoveryPoint.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadSqlPointInTimeRecoveryPointTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRecoveryPoint ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRecoveryPoint).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadSqlPointInTimeRecoveryPoint.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadSqlPointInTimeRecoveryPoint.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadSqlPointInTimeRecoveryPoint.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRecoveryPoint.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRecoveryPoint.cs new file mode 100644 index 000000000000..d02c4572f26a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRecoveryPoint.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point specific to PointInTime + public partial class AzureWorkloadSqlPointInTimeRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPoint __azureWorkloadSqlRecoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo ExtendedInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ExtendedInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ISqlDataDirectory[] ExtendedInfoDataDirectoryPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ExtendedInfoDataDirectoryPath; } + + /// 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.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ExtendedInfoDataDirectoryTimeInUtc; } + + /// Internal Acessors for RecoveryPointTimeInUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal.RecoveryPointTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointTimeInUtc = value; } + + /// Internal Acessors for Type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).Type = value; } + + /// Internal Acessors for ExtendedInfoDataDirectoryPath + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal.ExtendedInfoDataDirectoryPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ExtendedInfoDataDirectoryPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ExtendedInfoDataDirectoryPath = value; } + + /// Internal Acessors for ExtendedInfoDataDirectoryTimeInUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal.ExtendedInfoDataDirectoryTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ExtendedInfoDataDirectoryTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ExtendedInfoDataDirectoryTimeInUtc = 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.Api20241115.IRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointMoveReadinessInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointMoveReadinessInfo = value ?? null /* model class */; } + + /// Properties of Recovery Point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties RecoveryPointProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointProperty = value ?? null /* model class */; } + + /// Expiry time of Recovery Point in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RecoveryPointPropertyExpiryTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointPropertyExpiryTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointPropertyExpiryTime = value ?? null; } + + /// Bool to indicate whether RP is in soft delete state or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? RecoveryPointPropertyIsSoftDeleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointPropertyIsSoftDeleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointPropertyIsSoftDeleted = value ?? default(bool); } + + /// Rule name tagged on Recovery Point that governs life cycle + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RecoveryPointPropertyRuleName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointPropertyRuleName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointPropertyRuleName = value ?? null; } + + /// Recovery point tier information. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[] RecoveryPointTierDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointTierDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).RecoveryPointTimeInUtc; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadSqlRecoveryPoint).Type; } + + /// + /// 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.Api20241115.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.Api20241115.IPointInTimeRange) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange[] TimeRange { get; set; } + + } + /// Recovery point specific to PointInTime + internal partial interface IAzureWorkloadSqlPointInTimeRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal + { + /// List of log ranges + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange[] TimeRange { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRecoveryPoint.json.cs new file mode 100644 index 000000000000..131f57eaa271 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRecoveryPoint.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.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.Api20241115.IPointInTimeRange) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.PointInTimeRange.FromJson(__u) )) ))() : null : TimeRange;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRecoveryPoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRestoreRequest.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRestoreRequest.PowerShell.cs new file mode 100644 index 000000000000..cd788a856d9f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRestoreRequest.PowerShell.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// AzureWorkload SQL -specific restore. Specifically for PointInTime/Log restore + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSqlPointInTimeRestoreRequestTypeConverter))] + public partial class AzureWorkloadSqlPointInTimeRestoreRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadSqlPointInTimeRestoreRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PointInTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRestoreRequestInternal)this).PointInTime = (global::System.DateTime?) content.GetValueForProperty("PointInTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRestoreRequestInternal)this).PointInTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions?) content.GetValueForProperty("TargetInfoOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions.CreateFrom); + } + if (content.Contains("TargetInfoContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId = (string) content.GetValueForProperty("TargetInfoContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName = (string) content.GetValueForProperty("TargetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoTargetDirectoryForFileRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore = (string) content.GetValueForProperty("TargetInfoTargetDirectoryForFileRestore",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore, global::System.Convert.ToString); + } + if (content.Contains("TargetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo) content.GetValueForProperty("TargetInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetRestoreInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequestPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode?) content.GetValueForProperty("RecoveryMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode.CreateFrom); + } + if (content.Contains("TargetVirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId = (string) content.GetValueForProperty("TargetVirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId, global::System.Convert.ToString); + } + if (content.Contains("ShouldUseAlternateTargetLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).ShouldUseAlternateTargetLocation = (bool?) content.GetValueForProperty("ShouldUseAlternateTargetLocation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).ShouldUseAlternateTargetLocation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsNonRecoverable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).IsNonRecoverable = (bool?) content.GetValueForProperty("IsNonRecoverable",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).IsNonRecoverable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AlternateDirectoryPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).AlternateDirectoryPath = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMapping[]) content.GetValueForProperty("AlternateDirectoryPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).AlternateDirectoryPath, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectoryMappingTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadSqlPointInTimeRestoreRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PointInTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRestoreRequestInternal)this).PointInTime = (global::System.DateTime?) content.GetValueForProperty("PointInTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRestoreRequestInternal)this).PointInTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions?) content.GetValueForProperty("TargetInfoOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions.CreateFrom); + } + if (content.Contains("TargetInfoContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId = (string) content.GetValueForProperty("TargetInfoContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName = (string) content.GetValueForProperty("TargetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoTargetDirectoryForFileRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore = (string) content.GetValueForProperty("TargetInfoTargetDirectoryForFileRestore",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore, global::System.Convert.ToString); + } + if (content.Contains("TargetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo) content.GetValueForProperty("TargetInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetRestoreInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequestPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode?) content.GetValueForProperty("RecoveryMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode.CreateFrom); + } + if (content.Contains("TargetVirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId = (string) content.GetValueForProperty("TargetVirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId, global::System.Convert.ToString); + } + if (content.Contains("ShouldUseAlternateTargetLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).ShouldUseAlternateTargetLocation = (bool?) content.GetValueForProperty("ShouldUseAlternateTargetLocation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).ShouldUseAlternateTargetLocation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsNonRecoverable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).IsNonRecoverable = (bool?) content.GetValueForProperty("IsNonRecoverable",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).IsNonRecoverable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AlternateDirectoryPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).AlternateDirectoryPath = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMapping[]) content.GetValueForProperty("AlternateDirectoryPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).AlternateDirectoryPath, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectoryMappingTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRestoreRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadSqlPointInTimeRestoreRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRestoreRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadSqlPointInTimeRestoreRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRestoreRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// AzureWorkload SQL -specific restore. Specifically for PointInTime/Log restore + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSqlPointInTimeRestoreRequestTypeConverter))] + public partial interface IAzureWorkloadSqlPointInTimeRestoreRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRestoreRequest.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRestoreRequest.TypeConverter.cs new file mode 100644 index 000000000000..b1b4f712a82e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRestoreRequest.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadSqlPointInTimeRestoreRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRestoreRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRestoreRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadSqlPointInTimeRestoreRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadSqlPointInTimeRestoreRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadSqlPointInTimeRestoreRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRestoreRequest.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRestoreRequest.cs new file mode 100644 index 000000000000..b09158c02034 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IAzureWorkloadSqlPointInTimeRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequest __azureWorkloadSqlRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlRestoreRequest(); + + /// Data directory details + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMapping[] AlternateDirectoryPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).AlternateDirectoryPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).IsNonRecoverable; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).RecoveryMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).RecoveryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).ShouldUseAlternateTargetLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ITargetRestoreInfo TargetInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetInfoTargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadSqlRestoreRequest).TargetVirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IAzureWorkloadSqlRestoreRequestInternal + { + /// PointInTime value + global::System.DateTime? PointInTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRestoreRequest.json.cs new file mode 100644 index 000000000000..585121b59b90 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlPointInTimeRestoreRequest.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.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.Api20241115.IAzureWorkloadSqlPointInTimeRestoreRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlPointInTimeRestoreRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AzureWorkloadSqlPointInTimeRestoreRequest(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._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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPoint.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPoint.PowerShell.cs new file mode 100644 index 000000000000..d5a8806b8bcb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPoint.PowerShell.cs @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info + /// + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSqlRecoveryPointTypeConverter))] + public partial class AzureWorkloadSqlRecoveryPoint + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadSqlRecoveryPoint(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlRecoveryPointExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType.CreateFrom); + } + if (content.Contains("RecoveryPointTierDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[]) content.GetValueForProperty("RecoveryPointTierDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointMoveReadinessInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo) content.GetValueForProperty("RecoveryPointMoveReadinessInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPointMoveReadinessInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoDataDirectoryTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoDataDirectoryTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoDataDirectoryPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryPath = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory[]) content.GetValueForProperty("ExtendedInfoDataDirectoryPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryPath, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectoryTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadSqlRecoveryPoint(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlRecoveryPointExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType.CreateFrom); + } + if (content.Contains("RecoveryPointTierDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[]) content.GetValueForProperty("RecoveryPointTierDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointTierDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointMoveReadinessInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo) content.GetValueForProperty("RecoveryPointMoveReadinessInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPointMoveReadinessInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoDataDirectoryTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoDataDirectoryTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoDataDirectoryPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryPath = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory[]) content.GetValueForProperty("ExtendedInfoDataDirectoryPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal)this).ExtendedInfoDataDirectoryPath, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectoryTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadSqlRecoveryPoint(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadSqlRecoveryPoint(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSqlRecoveryPointTypeConverter))] + public partial interface IAzureWorkloadSqlRecoveryPoint + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPoint.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPoint.TypeConverter.cs new file mode 100644 index 000000000000..304689ff5bc7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPoint.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadSqlRecoveryPointTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPoint ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPoint).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadSqlRecoveryPoint.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadSqlRecoveryPoint.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadSqlRecoveryPoint.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPoint.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPoint.cs new file mode 100644 index 000000000000..9c3cbc1264a6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPoint.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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.Api20241115.IAzureWorkloadSqlRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPoint __azureWorkloadRecoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRecoveryPoint(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ISqlDataDirectory[] ExtendedInfoDataDirectoryPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)ExtendedInfo).DataDirectoryPath; } + + /// 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.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)ExtendedInfo).DataDirectoryTimeInUtc; } + + /// Internal Acessors for RecoveryPointTimeInUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal.RecoveryPointTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTimeInUtc = value; } + + /// Internal Acessors for Type + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointType? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).Type = value; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlRecoveryPointExtendedInfo()); set { {_extendedInfo = value;} } } + + /// Internal Acessors for ExtendedInfoDataDirectoryPath + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal.ExtendedInfoDataDirectoryPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)ExtendedInfo).DataDirectoryPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)ExtendedInfo).DataDirectoryPath = value; } + + /// Internal Acessors for ExtendedInfoDataDirectoryTimeInUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointInternal.ExtendedInfoDataDirectoryTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)ExtendedInfo).DataDirectoryTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)ExtendedInfo).DataDirectoryTimeInUtc = 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.Api20241115.IRecoveryPointInternal)__azureWorkloadRecoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointMoveReadinessInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointMoveReadinessInfo = value ?? null /* model class */; } + + /// Properties of Recovery Point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties RecoveryPointProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointProperty = value ?? null /* model class */; } + + /// Expiry time of Recovery Point in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RecoveryPointPropertyExpiryTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyExpiryTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyExpiryTime = value ?? null; } + + /// Bool to indicate whether RP is in soft delete state or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? RecoveryPointPropertyIsSoftDeleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyIsSoftDeleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyIsSoftDeleted = value ?? default(bool); } + + /// Rule name tagged on Recovery Point that governs life cycle + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RecoveryPointPropertyRuleName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyRuleName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointPropertyRuleName = value ?? null; } + + /// Recovery point tier information. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[] RecoveryPointTierDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTierDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).RecoveryPointTimeInUtc; } + + /// 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.Api20241115.IAzureWorkloadRecoveryPointInternal)__azureWorkloadRecoveryPoint).Type; } + + /// 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.Api20241115.IAzureWorkloadRecoveryPoint + { + /// List of data directory paths during restore operation. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of data directory paths during restore operation.", + SerializedName = @"dataDirectoryPaths", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory[] ExtendedInfoDataDirectoryPath { get; } + /// UTC time at which data directory info was captured + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"UTC time at which data directory info was captured", + SerializedName = @"dataDirectoryTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExtendedInfoDataDirectoryTimeInUtc { get; } + + } + /// SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info + internal partial interface IAzureWorkloadSqlRecoveryPointInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo ExtendedInfo { get; set; } + /// List of data directory paths during restore operation. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPoint.json.cs new file mode 100644 index 000000000000..da237955720b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPoint.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.AzureWorkloadRecoveryPoint(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadSqlRecoveryPointExtendedInfo.FromJson(__jsonExtendedInfo) : ExtendedInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPoint. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadSqlRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPointExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPointExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..1d823adde28c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPointExtendedInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Extended info class details + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSqlRecoveryPointExtendedInfoTypeConverter))] + public partial class AzureWorkloadSqlRecoveryPointExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadSqlRecoveryPointExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DataDirectoryTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)this).DataDirectoryTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DataDirectoryTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)this).DataDirectoryTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataDirectoryPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)this).DataDirectoryPath = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory[]) content.GetValueForProperty("DataDirectoryPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)this).DataDirectoryPath, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectoryTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadSqlRecoveryPointExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DataDirectoryTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)this).DataDirectoryTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DataDirectoryTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)this).DataDirectoryTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataDirectoryPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)this).DataDirectoryPath = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory[]) content.GetValueForProperty("DataDirectoryPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal)this).DataDirectoryPath, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectoryTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadSqlRecoveryPointExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadSqlRecoveryPointExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Extended info class details + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSqlRecoveryPointExtendedInfoTypeConverter))] + public partial interface IAzureWorkloadSqlRecoveryPointExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPointExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPointExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..ef983907922f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPointExtendedInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadSqlRecoveryPointExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadSqlRecoveryPointExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadSqlRecoveryPointExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadSqlRecoveryPointExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPointExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPointExtendedInfo.cs new file mode 100644 index 000000000000..7eaf66b8f557 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPointExtendedInfo.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Extended info class details + public partial class AzureWorkloadSqlRecoveryPointExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ISqlDataDirectory[] DataDirectoryPath { get => this._dataDirectoryPath; } + + /// 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; } + + /// Internal Acessors for DataDirectoryPath + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal.DataDirectoryPath { get => this._dataDirectoryPath; set { {_dataDirectoryPath = value;} } } + + /// Internal Acessors for DataDirectoryTimeInUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfoInternal.DataDirectoryTimeInUtc { get => this._dataDirectoryTimeInUtc; set { {_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 = true, + Description = @"List of data directory paths during restore operation.", + SerializedName = @"dataDirectoryPaths", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory[] DataDirectoryPath { get; } + /// UTC time at which data directory info was captured + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"UTC time at which data directory info was captured", + SerializedName = @"dataDirectoryTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? DataDirectoryTimeInUtc { get; } + + } + /// Extended info class details + internal partial interface IAzureWorkloadSqlRecoveryPointExtendedInfoInternal + + { + /// List of data directory paths during restore operation. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPointExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPointExtendedInfo.json.cs new file mode 100644 index 000000000000..5e461c666c98 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRecoveryPointExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.ISqlDataDirectory) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectory.FromJson(__u) )) ))() : null : DataDirectoryPath;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRecoveryPointExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + 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 (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + 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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRestoreRequest.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRestoreRequest.PowerShell.cs new file mode 100644 index 000000000000..24b10ecae17e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRestoreRequest.PowerShell.cs @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// AzureWorkload SQL -specific restore. Specifically for full/diff restore + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSqlRestoreRequestTypeConverter))] + public partial class AzureWorkloadSqlRestoreRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureWorkloadSqlRestoreRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ShouldUseAlternateTargetLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).ShouldUseAlternateTargetLocation = (bool?) content.GetValueForProperty("ShouldUseAlternateTargetLocation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).ShouldUseAlternateTargetLocation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsNonRecoverable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).IsNonRecoverable = (bool?) content.GetValueForProperty("IsNonRecoverable",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).IsNonRecoverable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AlternateDirectoryPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).AlternateDirectoryPath = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMapping[]) content.GetValueForProperty("AlternateDirectoryPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).AlternateDirectoryPath, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectoryMappingTypeConverter.ConvertFrom)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions?) content.GetValueForProperty("TargetInfoOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions.CreateFrom); + } + if (content.Contains("TargetInfoContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId = (string) content.GetValueForProperty("TargetInfoContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName = (string) content.GetValueForProperty("TargetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoTargetDirectoryForFileRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore = (string) content.GetValueForProperty("TargetInfoTargetDirectoryForFileRestore",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore, global::System.Convert.ToString); + } + if (content.Contains("TargetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo) content.GetValueForProperty("TargetInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetRestoreInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequestPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode?) content.GetValueForProperty("RecoveryMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode.CreateFrom); + } + if (content.Contains("TargetVirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId = (string) content.GetValueForProperty("TargetVirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureWorkloadSqlRestoreRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ShouldUseAlternateTargetLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).ShouldUseAlternateTargetLocation = (bool?) content.GetValueForProperty("ShouldUseAlternateTargetLocation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).ShouldUseAlternateTargetLocation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsNonRecoverable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).IsNonRecoverable = (bool?) content.GetValueForProperty("IsNonRecoverable",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).IsNonRecoverable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AlternateDirectoryPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).AlternateDirectoryPath = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMapping[]) content.GetValueForProperty("AlternateDirectoryPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal)this).AlternateDirectoryPath, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectoryMappingTypeConverter.ConvertFrom)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoOverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions?) content.GetValueForProperty("TargetInfoOverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoOverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions.CreateFrom); + } + if (content.Contains("TargetInfoContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId = (string) content.GetValueForProperty("TargetInfoContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoContainerId, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoDatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName = (string) content.GetValueForProperty("TargetInfoDatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoDatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetInfoTargetDirectoryForFileRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore = (string) content.GetValueForProperty("TargetInfoTargetDirectoryForFileRestore",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfoTargetDirectoryForFileRestore, global::System.Convert.ToString); + } + if (content.Contains("TargetInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo) content.GetValueForProperty("TargetInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.TargetRestoreInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequestPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode?) content.GetValueForProperty("RecoveryMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).RecoveryMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryMode.CreateFrom); + } + if (content.Contains("TargetVirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId = (string) content.GetValueForProperty("TargetVirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)this).TargetVirtualMachineId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureWorkloadSqlRestoreRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureWorkloadSqlRestoreRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// AzureWorkload SQL -specific restore. Specifically for full/diff restore + [System.ComponentModel.TypeConverter(typeof(AzureWorkloadSqlRestoreRequestTypeConverter))] + public partial interface IAzureWorkloadSqlRestoreRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRestoreRequest.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRestoreRequest.TypeConverter.cs new file mode 100644 index 000000000000..c02ad093a793 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRestoreRequest.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureWorkloadSqlRestoreRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureWorkloadSqlRestoreRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureWorkloadSqlRestoreRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureWorkloadSqlRestoreRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRestoreRequest.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRestoreRequest.cs new file mode 100644 index 000000000000..fe6b9edb6643 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IAzureWorkloadSqlRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequest __azureWorkloadRestoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AzureWorkloadRestoreRequest(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IRestoreRequestInternal)__azureWorkloadRestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestPropertyBag PropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).RecoveryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ITargetRestoreInfo TargetInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoDatabaseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoOverwriteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetInfoTargetDirectoryForFileRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal)__azureWorkloadRestoreRequest).TargetVirtualMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.ISqlDataDirectoryMapping) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadRestoreRequestInternal + { + /// Data directory details + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRestoreRequest.json.cs new file mode 100644 index 000000000000..33a025485684 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/AzureWorkloadSqlRestoreRequest.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.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.Api20241115.ISqlDataDirectoryMapping) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.SqlDataDirectoryMapping.FromJson(__u) )) ))() : null : AlternateDirectoryPath;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAzureWorkloadSqlRestoreRequest. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IAzureWorkloadSqlRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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); + } + } + 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.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsage.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsage.PowerShell.cs new file mode 100644 index 000000000000..b150447ac092 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsage.PowerShell.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Backup management usages of a vault. + [System.ComponentModel.TypeConverter(typeof(BackupManagementUsageTypeConverter))] + public partial class BackupManagementUsage + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BackupManagementUsage(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfo) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.NameInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).Unit = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit?) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).Unit, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit.CreateFrom); + } + if (content.Contains("QuotaPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).QuotaPeriod = (string) content.GetValueForProperty("QuotaPeriod",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).QuotaPeriod, global::System.Convert.ToString); + } + if (content.Contains("NextResetTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).NextResetTime = (global::System.DateTime?) content.GetValueForProperty("NextResetTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).NextResetTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CurrentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).CurrentValue = (long?) content.GetValueForProperty("CurrentValue",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).CurrentValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Limit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).Limit = (long?) content.GetValueForProperty("Limit",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).Limit, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NameValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).NameValue, global::System.Convert.ToString); + } + if (content.Contains("NameLocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).NameLocalizedValue, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BackupManagementUsage(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfo) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.NameInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).Unit = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit?) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).Unit, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnit.CreateFrom); + } + if (content.Contains("QuotaPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).QuotaPeriod = (string) content.GetValueForProperty("QuotaPeriod",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).QuotaPeriod, global::System.Convert.ToString); + } + if (content.Contains("NextResetTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).NextResetTime = (global::System.DateTime?) content.GetValueForProperty("NextResetTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).NextResetTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CurrentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).CurrentValue = (long?) content.GetValueForProperty("CurrentValue",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).CurrentValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Limit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).Limit = (long?) content.GetValueForProperty("Limit",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).Limit, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NameValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).NameValue, global::System.Convert.ToString); + } + if (content.Contains("NameLocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal)this).NameLocalizedValue, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsage DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BackupManagementUsage(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BackupManagementUsage(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Backup management usages of a vault. + [System.ComponentModel.TypeConverter(typeof(BackupManagementUsageTypeConverter))] + public partial interface IBackupManagementUsage + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsage.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsage.TypeConverter.cs new file mode 100644 index 000000000000..e6a42e37af9c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsage.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupManagementUsageTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsage ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsage).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BackupManagementUsage.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BackupManagementUsage.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BackupManagementUsage.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsage.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsage.cs new file mode 100644 index 000000000000..f20c43db05af --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IBackupManagementUsage, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.INameInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageInternal.Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.NameInfo()); set { {_name = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.INameInfo Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.INameInfoInternal)Name).LocalizedValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.INameInfoInternal)Name).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsage.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsage.json.cs new file mode 100644 index 000000000000..9fd0a6f13b23 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsage.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.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.Api20241115.IBackupManagementUsage. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsage. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsageList.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsageList.PowerShell.cs new file mode 100644 index 000000000000..cfd42614bc75 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsageList.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Backup management usage for vault. + [System.ComponentModel.TypeConverter(typeof(BackupManagementUsageListTypeConverter))] + public partial class BackupManagementUsageList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BackupManagementUsageList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsage[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BackupManagementUsageTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BackupManagementUsageList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsage[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BackupManagementUsageTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BackupManagementUsageList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BackupManagementUsageList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Backup management usage for vault. + [System.ComponentModel.TypeConverter(typeof(BackupManagementUsageListTypeConverter))] + public partial interface IBackupManagementUsageList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsageList.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsageList.TypeConverter.cs new file mode 100644 index 000000000000..8de94fe0af8c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsageList.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupManagementUsageListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BackupManagementUsageList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BackupManagementUsageList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BackupManagementUsageList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsageList.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsageList.cs new file mode 100644 index 000000000000..a37bc63238c0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Backup management usage for vault. + public partial class BackupManagementUsageList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IBackupManagementUsage) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IBackupManagementUsage[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsageList.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsageList.json.cs new file mode 100644 index 000000000000..1f07d4942d89 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupManagementUsageList.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IBackupManagementUsage) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BackupManagementUsage.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfig.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfig.PowerShell.cs new file mode 100644 index 000000000000..357130bbbc93 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfig.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// The resource storage details. + [System.ComponentModel.TypeConverter(typeof(BackupResourceConfigTypeConverter))] + public partial class BackupResourceConfig + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BackupResourceConfig(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StorageModelType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).StorageModelType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType?) content.GetValueForProperty("StorageModelType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).StorageModelType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType.CreateFrom); + } + if (content.Contains("StorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).StorageType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType?) content.GetValueForProperty("StorageType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).StorageType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType.CreateFrom); + } + if (content.Contains("StorageTypeState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).StorageTypeState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState?) content.GetValueForProperty("StorageTypeState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).StorageTypeState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState.CreateFrom); + } + if (content.Contains("CrossRegionRestoreFlag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).CrossRegionRestoreFlag = (bool?) content.GetValueForProperty("CrossRegionRestoreFlag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).CrossRegionRestoreFlag, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BackupResourceConfig(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StorageModelType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).StorageModelType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType?) content.GetValueForProperty("StorageModelType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).StorageModelType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType.CreateFrom); + } + if (content.Contains("StorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).StorageType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType?) content.GetValueForProperty("StorageType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).StorageType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType.CreateFrom); + } + if (content.Contains("StorageTypeState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).StorageTypeState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState?) content.GetValueForProperty("StorageTypeState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).StorageTypeState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState.CreateFrom); + } + if (content.Contains("CrossRegionRestoreFlag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).CrossRegionRestoreFlag = (bool?) content.GetValueForProperty("CrossRegionRestoreFlag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)this).CrossRegionRestoreFlag, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfig DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BackupResourceConfig(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfig DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BackupResourceConfig(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfig FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The resource storage details. + [System.ComponentModel.TypeConverter(typeof(BackupResourceConfigTypeConverter))] + public partial interface IBackupResourceConfig + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfig.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfig.TypeConverter.cs new file mode 100644 index 000000000000..55d1aa97d072 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfig.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupResourceConfigTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfig ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfig).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BackupResourceConfig.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BackupResourceConfig.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BackupResourceConfig.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfig.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfig.cs new file mode 100644 index 000000000000..121890c33241 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfig.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The resource storage details. + public partial class BackupResourceConfig : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfig, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.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 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; } + /// 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; } + + } + /// The resource storage details. + internal partial interface IBackupResourceConfigInternal + + { + /// Opt in details of Cross Region Restore feature. + bool? CrossRegionRestoreFlag { 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.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfig.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfig.json.cs new file mode 100644 index 000000000000..ae986e4c41dd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfig.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfig. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfig. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfigResource.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfigResource.PowerShell.cs new file mode 100644 index 000000000000..be1d2f074c28 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfigResource.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// The resource storage details. + [System.ComponentModel.TypeConverter(typeof(BackupResourceConfigResourceTypeConverter))] + public partial class BackupResourceConfigResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BackupResourceConfigResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfig) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BackupResourceConfigTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("StorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).StorageType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType?) content.GetValueForProperty("StorageType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).StorageType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType.CreateFrom); + } + if (content.Contains("StorageModelType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).StorageModelType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType?) content.GetValueForProperty("StorageModelType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).StorageModelType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType.CreateFrom); + } + if (content.Contains("StorageTypeState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).StorageTypeState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState?) content.GetValueForProperty("StorageTypeState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).StorageTypeState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState.CreateFrom); + } + if (content.Contains("CrossRegionRestoreFlag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).CrossRegionRestoreFlag = (bool?) content.GetValueForProperty("CrossRegionRestoreFlag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).CrossRegionRestoreFlag, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BackupResourceConfigResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfig) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BackupResourceConfigTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("StorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).StorageType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType?) content.GetValueForProperty("StorageType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).StorageType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType.CreateFrom); + } + if (content.Contains("StorageModelType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).StorageModelType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType?) content.GetValueForProperty("StorageModelType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).StorageModelType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType.CreateFrom); + } + if (content.Contains("StorageTypeState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).StorageTypeState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState?) content.GetValueForProperty("StorageTypeState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).StorageTypeState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState.CreateFrom); + } + if (content.Contains("CrossRegionRestoreFlag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).CrossRegionRestoreFlag = (bool?) content.GetValueForProperty("CrossRegionRestoreFlag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal)this).CrossRegionRestoreFlag, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BackupResourceConfigResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BackupResourceConfigResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The resource storage details. + [System.ComponentModel.TypeConverter(typeof(BackupResourceConfigResourceTypeConverter))] + public partial interface IBackupResourceConfigResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfigResource.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfigResource.TypeConverter.cs new file mode 100644 index 000000000000..e5fd619b9d05 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfigResource.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupResourceConfigResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BackupResourceConfigResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BackupResourceConfigResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BackupResourceConfigResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfigResource.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfigResource.cs new file mode 100644 index 000000000000..cb1b7164d4b2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfigResource.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The resource storage details. + public partial class BackupResourceConfigResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IBackupResourceConfigInternal)Property).CrossRegionRestoreFlag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigInternal)Property).CrossRegionRestoreFlag = value ?? default(bool); } + + /// 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.Api20241115.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfig Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BackupResourceConfig()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfig _property; + + /// BackupResourceConfigResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfig Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IBackupResourceConfigInternal)Property).StorageModelType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IBackupResourceConfigInternal)Property).StorageType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IBackupResourceConfigInternal)Property).StorageTypeState; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).Type; } + + /// 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.Api20241115.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; } + /// 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; } + + } + /// The resource storage details. + internal partial interface IBackupResourceConfigResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal + { + /// Opt in details of Cross Region Restore feature. + bool? CrossRegionRestoreFlag { get; set; } + /// BackupResourceConfigResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfigResource.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfigResource.json.cs new file mode 100644 index 000000000000..a8f1dc077ba5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BackupResourceConfigResource.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BackupResourceConfig.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/BekDetails.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BekDetails.PowerShell.cs new file mode 100644 index 000000000000..f90683b63b9a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BekDetails.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// BEK is bitlocker encryption key. + [System.ComponentModel.TypeConverter(typeof(BekDetailsTypeConverter))] + public partial class BekDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BekDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SecretUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetailsInternal)this).SecretUrl = (string) content.GetValueForProperty("SecretUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetailsInternal)this).SecretUrl, global::System.Convert.ToString); + } + if (content.Contains("SecretVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetailsInternal)this).SecretVaultId = (string) content.GetValueForProperty("SecretVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetailsInternal)this).SecretVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetailsInternal)this).SecretData = (string) content.GetValueForProperty("SecretData",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetailsInternal)this).SecretData, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BekDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SecretUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetailsInternal)this).SecretUrl = (string) content.GetValueForProperty("SecretUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetailsInternal)this).SecretUrl, global::System.Convert.ToString); + } + if (content.Contains("SecretVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetailsInternal)this).SecretVaultId = (string) content.GetValueForProperty("SecretVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetailsInternal)this).SecretVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetailsInternal)this).SecretData = (string) content.GetValueForProperty("SecretData",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetailsInternal)this).SecretData, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BekDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BekDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// BEK is bitlocker encryption key. + [System.ComponentModel.TypeConverter(typeof(BekDetailsTypeConverter))] + public partial interface IBekDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BekDetails.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BekDetails.TypeConverter.cs new file mode 100644 index 000000000000..6456976557a1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BekDetails.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BekDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BekDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BekDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BekDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BekDetails.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BekDetails.cs new file mode 100644 index 000000000000..9171f0f7fc13 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// BEK is bitlocker encryption key. + public partial class BekDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/BekDetails.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BekDetails.json.cs new file mode 100644 index 000000000000..c85d60070f60 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BekDetails.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IBekDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/BmsBackupSummariesQueryObject.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsBackupSummariesQueryObject.PowerShell.cs new file mode 100644 index 000000000000..1cbbfb059ad7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsBackupSummariesQueryObject.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Query parameters to fetch backup summaries. + [System.ComponentModel.TypeConverter(typeof(BmsBackupSummariesQueryObjectTypeConverter))] + public partial class BmsBackupSummariesQueryObject + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BmsBackupSummariesQueryObject(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsBackupSummariesQueryObjectInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsBackupSummariesQueryObjectInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BmsBackupSummariesQueryObject(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsBackupSummariesQueryObjectInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsBackupSummariesQueryObjectInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.Type.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsBackupSummariesQueryObject DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BmsBackupSummariesQueryObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsBackupSummariesQueryObject DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BmsBackupSummariesQueryObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsBackupSummariesQueryObject FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Query parameters to fetch backup summaries. + [System.ComponentModel.TypeConverter(typeof(BmsBackupSummariesQueryObjectTypeConverter))] + public partial interface IBmsBackupSummariesQueryObject + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsBackupSummariesQueryObject.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsBackupSummariesQueryObject.TypeConverter.cs new file mode 100644 index 000000000000..b6d1509db8c6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsBackupSummariesQueryObject.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BmsBackupSummariesQueryObjectTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsBackupSummariesQueryObject ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsBackupSummariesQueryObject).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BmsBackupSummariesQueryObject.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BmsBackupSummariesQueryObject.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BmsBackupSummariesQueryObject.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsBackupSummariesQueryObject.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsBackupSummariesQueryObject.cs new file mode 100644 index 000000000000..b301dda29f1f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IBmsBackupSummariesQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/BmsBackupSummariesQueryObject.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsBackupSummariesQueryObject.json.cs new file mode 100644 index 000000000000..6bdb0b15504d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsBackupSummariesQueryObject.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IBmsBackupSummariesQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsBackupSummariesQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/BmsaadPropertiesQueryObject.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsaadPropertiesQueryObject.PowerShell.cs new file mode 100644 index 000000000000..13aa68f0dc71 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsaadPropertiesQueryObject.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Filters to list backup items. + [System.ComponentModel.TypeConverter(typeof(BmsaadPropertiesQueryObjectTypeConverter))] + public partial class BmsaadPropertiesQueryObject + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BmsaadPropertiesQueryObject(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsaadPropertiesQueryObjectInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsaadPropertiesQueryObjectInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BmsaadPropertiesQueryObject(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsaadPropertiesQueryObjectInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsaadPropertiesQueryObjectInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsaadPropertiesQueryObject DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BmsaadPropertiesQueryObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsaadPropertiesQueryObject DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BmsaadPropertiesQueryObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsaadPropertiesQueryObject FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Filters to list backup items. + [System.ComponentModel.TypeConverter(typeof(BmsaadPropertiesQueryObjectTypeConverter))] + public partial interface IBmsaadPropertiesQueryObject + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsaadPropertiesQueryObject.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsaadPropertiesQueryObject.TypeConverter.cs new file mode 100644 index 000000000000..1eb85d8c824d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsaadPropertiesQueryObject.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BmsaadPropertiesQueryObjectTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsaadPropertiesQueryObject ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsaadPropertiesQueryObject).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BmsaadPropertiesQueryObject.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BmsaadPropertiesQueryObject.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BmsaadPropertiesQueryObject.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsaadPropertiesQueryObject.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsaadPropertiesQueryObject.cs new file mode 100644 index 000000000000..8334e01b4b1a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsaadPropertiesQueryObject.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list backup items. + public partial class BmsaadPropertiesQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsaadPropertiesQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsaadPropertiesQueryObjectInternal + { + + /// 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; } + + /// Creates an new instance. + public BmsaadPropertiesQueryObject() + { + + } + } + /// Filters to list backup items. + public partial interface IBmsaadPropertiesQueryObject : + 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; } + + } + /// Filters to list backup items. + internal partial interface IBmsaadPropertiesQueryObjectInternal + + { + /// Backup management type for the backed up item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType? BackupManagementType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsaadPropertiesQueryObject.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsaadPropertiesQueryObject.json.cs new file mode 100644 index 000000000000..bacb85871133 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsaadPropertiesQueryObject.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list backup items. + public partial class BmsaadPropertiesQueryObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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 BmsaadPropertiesQueryObject(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.Api20241115.IBmsaadPropertiesQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsaadPropertiesQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsaadPropertiesQueryObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new BmsaadPropertiesQueryObject(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.DefaultTag/generated/api/Models/Api20241115/BmsrpQueryObject.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsrpQueryObject.PowerShell.cs new file mode 100644 index 000000000000..f9fffa2d9d5b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsrpQueryObject.PowerShell.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Filters to list backup copies. + [System.ComponentModel.TypeConverter(typeof(BmsrpQueryObjectTypeConverter))] + public partial class BmsrpQueryObject + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BmsrpQueryObject(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).StartDate = (global::System.DateTime?) content.GetValueForProperty("StartDate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).StartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).EndDate = (global::System.DateTime?) content.GetValueForProperty("EndDate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).EndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RestorePointQueryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).RestorePointQueryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType?) content.GetValueForProperty("RestorePointQueryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).RestorePointQueryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType.CreateFrom); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).ExtendedInfo = (bool?) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).ExtendedInfo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MoveReadyRpOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).MoveReadyRpOnly = (bool?) content.GetValueForProperty("MoveReadyRpOnly",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).MoveReadyRpOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IncludeSoftDeletedRp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).IncludeSoftDeletedRp = (bool?) content.GetValueForProperty("IncludeSoftDeletedRp",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).IncludeSoftDeletedRp, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BmsrpQueryObject(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).StartDate = (global::System.DateTime?) content.GetValueForProperty("StartDate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).StartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).EndDate = (global::System.DateTime?) content.GetValueForProperty("EndDate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).EndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RestorePointQueryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).RestorePointQueryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType?) content.GetValueForProperty("RestorePointQueryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).RestorePointQueryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryType.CreateFrom); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).ExtendedInfo = (bool?) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).ExtendedInfo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MoveReadyRpOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).MoveReadyRpOnly = (bool?) content.GetValueForProperty("MoveReadyRpOnly",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).MoveReadyRpOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IncludeSoftDeletedRp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).IncludeSoftDeletedRp = (bool?) content.GetValueForProperty("IncludeSoftDeletedRp",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObjectInternal)this).IncludeSoftDeletedRp, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObject DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BmsrpQueryObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObject DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BmsrpQueryObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObject FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Filters to list backup copies. + [System.ComponentModel.TypeConverter(typeof(BmsrpQueryObjectTypeConverter))] + public partial interface IBmsrpQueryObject + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsrpQueryObject.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsrpQueryObject.TypeConverter.cs new file mode 100644 index 000000000000..04c69044c84c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsrpQueryObject.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BmsrpQueryObjectTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObject ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObject).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BmsrpQueryObject.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BmsrpQueryObject.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BmsrpQueryObject.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsrpQueryObject.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsrpQueryObject.cs new file mode 100644 index 000000000000..a02f151ca55f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsrpQueryObject.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list backup copies. + public partial class BmsrpQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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? _includeSoftDeletedRp; + + /// + /// Flag to indicate whether Soft Deleted RPs should be included/excluded from result. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IncludeSoftDeletedRp { get => this._includeSoftDeletedRp; set => this._includeSoftDeletedRp = 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; } + /// + /// Flag to indicate whether Soft Deleted RPs should be included/excluded from result. + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag to indicate whether Soft Deleted RPs should be included/excluded from result.", + SerializedName = @"includeSoftDeletedRP", + PossibleTypes = new [] { typeof(bool) })] + bool? IncludeSoftDeletedRp { 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; } + /// + /// Flag to indicate whether Soft Deleted RPs should be included/excluded from result. + /// + bool? IncludeSoftDeletedRp { 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.DefaultTag/generated/api/Models/Api20241115/BmsrpQueryObject.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsrpQueryObject.json.cs new file mode 100644 index 000000000000..1054fc6d9bbd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/BmsrpQueryObject.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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;} + {_includeSoftDeletedRp = If( json?.PropertyT("includeSoftDeletedRP"), out var __jsonIncludeSoftDeletedRp) ? (bool?)__jsonIncludeSoftDeletedRp : IncludeSoftDeletedRp;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBmsrpQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 ); + AddIf( null != this._includeSoftDeletedRp ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._includeSoftDeletedRp) : null, "includeSoftDeletedRP" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ClientScriptForConnect.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ClientScriptForConnect.PowerShell.cs new file mode 100644 index 000000000000..acf1da6f74e7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ClientScriptForConnect.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Client script details for file / folder restore. + [System.ComponentModel.TypeConverter(typeof(ClientScriptForConnectTypeConverter))] + public partial class ClientScriptForConnect + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ClientScriptForConnect(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ScriptContent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).ScriptContent = (string) content.GetValueForProperty("ScriptContent",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).ScriptContent, global::System.Convert.ToString); + } + if (content.Contains("ScriptExtension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).ScriptExtension = (string) content.GetValueForProperty("ScriptExtension",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).ScriptExtension, global::System.Convert.ToString); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).OSType, global::System.Convert.ToString); + } + if (content.Contains("Url")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).Url = (string) content.GetValueForProperty("Url",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).Url, global::System.Convert.ToString); + } + if (content.Contains("ScriptNameSuffix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).ScriptNameSuffix = (string) content.GetValueForProperty("ScriptNameSuffix",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).ScriptNameSuffix, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ClientScriptForConnect(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ScriptContent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).ScriptContent = (string) content.GetValueForProperty("ScriptContent",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).ScriptContent, global::System.Convert.ToString); + } + if (content.Contains("ScriptExtension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).ScriptExtension = (string) content.GetValueForProperty("ScriptExtension",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).ScriptExtension, global::System.Convert.ToString); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).OSType, global::System.Convert.ToString); + } + if (content.Contains("Url")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).Url = (string) content.GetValueForProperty("Url",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).Url, global::System.Convert.ToString); + } + if (content.Contains("ScriptNameSuffix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).ScriptNameSuffix = (string) content.GetValueForProperty("ScriptNameSuffix",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnectInternal)this).ScriptNameSuffix, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnect DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClientScriptForConnect(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnect DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClientScriptForConnect(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnect FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Client script details for file / folder restore. + [System.ComponentModel.TypeConverter(typeof(ClientScriptForConnectTypeConverter))] + public partial interface IClientScriptForConnect + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ClientScriptForConnect.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ClientScriptForConnect.TypeConverter.cs new file mode 100644 index 000000000000..b5fd43742579 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ClientScriptForConnect.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ClientScriptForConnectTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnect ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnect).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ClientScriptForConnect.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ClientScriptForConnect.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ClientScriptForConnect.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ClientScriptForConnect.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ClientScriptForConnect.cs new file mode 100644 index 000000000000..4dbb19e0d26e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IClientScriptForConnect, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/ClientScriptForConnect.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ClientScriptForConnect.json.cs new file mode 100644 index 000000000000..2cceed560958 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ClientScriptForConnect.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IClientScriptForConnect. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnect. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequest.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequest.PowerShell.cs new file mode 100644 index 000000000000..f0361e4eb276 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequest.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(CrossRegionRestoreRequestTypeConverter))] + public partial class CrossRegionRestoreRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CrossRegionRestoreRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RestoreRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)this).RestoreRequest = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest) content.GetValueForProperty("RestoreRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)this).RestoreRequest, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RestoreRequestTypeConverter.ConvertFrom); + } + if (content.Contains("CrossRegionRestoreAccessDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)this).CrossRegionRestoreAccessDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken) content.GetValueForProperty("CrossRegionRestoreAccessDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)this).CrossRegionRestoreAccessDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenTypeConverter.ConvertFrom); + } + if (content.Contains("RestoreRequestObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)this).RestoreRequestObjectType = (string) content.GetValueForProperty("RestoreRequestObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)this).RestoreRequestObjectType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CrossRegionRestoreRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RestoreRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)this).RestoreRequest = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest) content.GetValueForProperty("RestoreRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)this).RestoreRequest, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RestoreRequestTypeConverter.ConvertFrom); + } + if (content.Contains("CrossRegionRestoreAccessDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)this).CrossRegionRestoreAccessDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken) content.GetValueForProperty("CrossRegionRestoreAccessDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)this).CrossRegionRestoreAccessDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenTypeConverter.ConvertFrom); + } + if (content.Contains("RestoreRequestObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)this).RestoreRequestObjectType = (string) content.GetValueForProperty("RestoreRequestObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)this).RestoreRequestObjectType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CrossRegionRestoreRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CrossRegionRestoreRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(CrossRegionRestoreRequestTypeConverter))] + public partial interface ICrossRegionRestoreRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequest.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequest.TypeConverter.cs new file mode 100644 index 000000000000..3cc97bf3f1f5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequest.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CrossRegionRestoreRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CrossRegionRestoreRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CrossRegionRestoreRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CrossRegionRestoreRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequest.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequest.cs new file mode 100644 index 000000000000..2a3822204dec --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequest.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class CrossRegionRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken _crossRegionRestoreAccessDetail; + + /// Access details for cross region restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken CrossRegionRestoreAccessDetail { get => (this._crossRegionRestoreAccessDetail = this._crossRegionRestoreAccessDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessToken()); set => this._crossRegionRestoreAccessDetail = value; } + + /// Internal Acessors for RestoreRequest + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal.RestoreRequest { get => (this._restoreRequest = this._restoreRequest ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RestoreRequest()); set { {_restoreRequest = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest _restoreRequest; + + /// Request object for triggering restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest RestoreRequest { get => (this._restoreRequest = this._restoreRequest ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRestoreRequestInternal)RestoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)RestoreRequest).ObjectType = value ?? null; } + + /// Creates an new instance. + public CrossRegionRestoreRequest() + { + + } + } + public partial interface ICrossRegionRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Access details for cross region restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access details for cross region restore", + SerializedName = @"crossRegionRestoreAccessDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken CrossRegionRestoreAccessDetail { 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 RestoreRequestObjectType { get; set; } + + } + internal partial interface ICrossRegionRestoreRequestInternal + + { + /// Access details for cross region restore + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken CrossRegionRestoreAccessDetail { get; set; } + /// Request object for triggering restore + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequest.json.cs new file mode 100644 index 000000000000..6e61dcbad38d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequest.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class CrossRegionRestoreRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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 CrossRegionRestoreRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_restoreRequest = If( json?.PropertyT("restoreRequest"), out var __jsonRestoreRequest) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RestoreRequest.FromJson(__jsonRestoreRequest) : RestoreRequest;} + {_crossRegionRestoreAccessDetail = If( json?.PropertyT("crossRegionRestoreAccessDetails"), out var __jsonCrossRegionRestoreAccessDetails) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessToken.FromJson(__jsonCrossRegionRestoreAccessDetails) : CrossRegionRestoreAccessDetail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new CrossRegionRestoreRequest(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._restoreRequest ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._restoreRequest.ToJson(null,serializationMode) : null, "restoreRequest" ,container.Add ); + AddIf( null != this._crossRegionRestoreAccessDetail ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._crossRegionRestoreAccessDetail.ToJson(null,serializationMode) : null, "crossRegionRestoreAccessDetails" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequestResource.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequestResource.PowerShell.cs new file mode 100644 index 000000000000..ebc3909637b7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequestResource.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(CrossRegionRestoreRequestResourceTypeConverter))] + public partial class CrossRegionRestoreRequestResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CrossRegionRestoreRequestResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrossRegionRestoreRequestTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("RestoreRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).RestoreRequest = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest) content.GetValueForProperty("RestoreRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).RestoreRequest, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RestoreRequestTypeConverter.ConvertFrom); + } + if (content.Contains("CrossRegionRestoreAccessDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).CrossRegionRestoreAccessDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken) content.GetValueForProperty("CrossRegionRestoreAccessDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).CrossRegionRestoreAccessDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenTypeConverter.ConvertFrom); + } + if (content.Contains("RestoreRequestObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).RestoreRequestObjectType = (string) content.GetValueForProperty("RestoreRequestObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).RestoreRequestObjectType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CrossRegionRestoreRequestResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrossRegionRestoreRequestTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("RestoreRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).RestoreRequest = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest) content.GetValueForProperty("RestoreRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).RestoreRequest, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RestoreRequestTypeConverter.ConvertFrom); + } + if (content.Contains("CrossRegionRestoreAccessDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).CrossRegionRestoreAccessDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken) content.GetValueForProperty("CrossRegionRestoreAccessDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).CrossRegionRestoreAccessDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenTypeConverter.ConvertFrom); + } + if (content.Contains("RestoreRequestObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).RestoreRequestObjectType = (string) content.GetValueForProperty("RestoreRequestObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal)this).RestoreRequestObjectType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CrossRegionRestoreRequestResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CrossRegionRestoreRequestResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(CrossRegionRestoreRequestResourceTypeConverter))] + public partial interface ICrossRegionRestoreRequestResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequestResource.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequestResource.TypeConverter.cs new file mode 100644 index 000000000000..56016b8070aa --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequestResource.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CrossRegionRestoreRequestResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CrossRegionRestoreRequestResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CrossRegionRestoreRequestResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CrossRegionRestoreRequestResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequestResource.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequestResource.cs new file mode 100644 index 000000000000..f2565199aeb4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequestResource.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class CrossRegionRestoreRequestResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.Resource(); + + /// Access details for cross region restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken CrossRegionRestoreAccessDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)Property).CrossRegionRestoreAccessDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)Property).CrossRegionRestoreAccessDetail = value ?? null /* model class */; } + + /// 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.Api20241115.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrossRegionRestoreRequest()); set { {_property = value;} } } + + /// Internal Acessors for RestoreRequest + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResourceInternal.RestoreRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)Property).RestoreRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)Property).RestoreRequest = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest _property; + + /// CrossRegionRestoreRequestResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrossRegionRestoreRequest()); set => this._property = 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.Api20241115.ICrossRegionRestoreRequestInternal)Property).RestoreRequestObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestInternal)Property).RestoreRequestObjectType = value ?? null; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public CrossRegionRestoreRequestResource() + { + + } + + /// 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 ICrossRegionRestoreRequestResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource + { + /// Access details for cross region restore + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access details for cross region restore", + SerializedName = @"crossRegionRestoreAccessDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken CrossRegionRestoreAccessDetail { 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 RestoreRequestObjectType { get; set; } + + } + internal partial interface ICrossRegionRestoreRequestResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal + { + /// Access details for cross region restore + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken CrossRegionRestoreAccessDetail { get; set; } + /// CrossRegionRestoreRequestResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest Property { get; set; } + /// Request object for triggering restore + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequestResource.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequestResource.json.cs new file mode 100644 index 000000000000..18570215445e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrossRegionRestoreRequestResource.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class CrossRegionRestoreRequestResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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 CrossRegionRestoreRequestResource(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.Api20241115.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrossRegionRestoreRequest.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequestResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new CrossRegionRestoreRequestResource(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.DefaultTag/generated/api/Models/Api20241115/CrrAccessToken.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessToken.PowerShell.cs new file mode 100644 index 000000000000..9632ccd104b5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessToken.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(CrrAccessTokenTypeConverter))] + public partial class CrrAccessToken + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CrrAccessToken(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("AccessTokenString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).AccessTokenString = (string) content.GetValueForProperty("AccessTokenString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).AccessTokenString, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionContainerId = (long?) content.GetValueForProperty("ProtectionContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionContainerId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RecoveryPointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointId = (string) content.GetValueForProperty("RecoveryPointId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointId, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointTime = (string) content.GetValueForProperty("RecoveryPointTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointTime, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("ContainerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerType = (string) content.GetValueForProperty("ContainerType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerType, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BackupManagementType = (string) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BackupManagementType, global::System.Convert.ToString); + } + if (content.Contains("DatasourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceType = (string) content.GetValueForProperty("DatasourceType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceType, global::System.Convert.ToString); + } + if (content.Contains("DatasourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceName = (string) content.GetValueForProperty("DatasourceName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceName, global::System.Convert.ToString); + } + if (content.Contains("DatasourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceId = (string) content.GetValueForProperty("DatasourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceId, global::System.Convert.ToString); + } + if (content.Contains("DatasourceContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceContainerName = (string) content.GetValueForProperty("DatasourceContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceContainerName, global::System.Convert.ToString); + } + if (content.Contains("CoordinatorServiceStampId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampId = (string) content.GetValueForProperty("CoordinatorServiceStampId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampId, global::System.Convert.ToString); + } + if (content.Contains("CoordinatorServiceStampUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampUri = (string) content.GetValueForProperty("CoordinatorServiceStampUri",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampUri, global::System.Convert.ToString); + } + if (content.Contains("ProtectionServiceStampId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampId = (string) content.GetValueForProperty("ProtectionServiceStampId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionServiceStampUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampUri = (string) content.GetValueForProperty("ProtectionServiceStampUri",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampUri, global::System.Convert.ToString); + } + if (content.Contains("TokenExtendedInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).TokenExtendedInformation = (string) content.GetValueForProperty("TokenExtendedInformation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).TokenExtendedInformation, global::System.Convert.ToString); + } + if (content.Contains("RpTierInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpTierInformation = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation) content.GetValueForProperty("RpTierInformation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpTierInformation, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenRpTierInformationTypeConverter.ConvertFrom); + } + if (content.Contains("RpOriginalSaOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpOriginalSaOption = (bool?) content.GetValueForProperty("RpOriginalSaOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpOriginalSaOption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RpIsManagedVirtualMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpIsManagedVirtualMachine = (bool?) content.GetValueForProperty("RpIsManagedVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpIsManagedVirtualMachine, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RpVMSizeDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpVMSizeDescription = (string) content.GetValueForProperty("RpVMSizeDescription",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpVMSizeDescription, global::System.Convert.ToString); + } + if (content.Contains("BmsActiveRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BmsActiveRegion = (string) content.GetValueForProperty("BmsActiveRegion",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BmsActiveRegion, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CrrAccessToken(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("AccessTokenString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).AccessTokenString = (string) content.GetValueForProperty("AccessTokenString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).AccessTokenString, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionContainerId = (long?) content.GetValueForProperty("ProtectionContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionContainerId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RecoveryPointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointId = (string) content.GetValueForProperty("RecoveryPointId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointId, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointTime = (string) content.GetValueForProperty("RecoveryPointTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointTime, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("ContainerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerType = (string) content.GetValueForProperty("ContainerType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerType, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BackupManagementType = (string) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BackupManagementType, global::System.Convert.ToString); + } + if (content.Contains("DatasourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceType = (string) content.GetValueForProperty("DatasourceType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceType, global::System.Convert.ToString); + } + if (content.Contains("DatasourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceName = (string) content.GetValueForProperty("DatasourceName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceName, global::System.Convert.ToString); + } + if (content.Contains("DatasourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceId = (string) content.GetValueForProperty("DatasourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceId, global::System.Convert.ToString); + } + if (content.Contains("DatasourceContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceContainerName = (string) content.GetValueForProperty("DatasourceContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceContainerName, global::System.Convert.ToString); + } + if (content.Contains("CoordinatorServiceStampId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampId = (string) content.GetValueForProperty("CoordinatorServiceStampId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampId, global::System.Convert.ToString); + } + if (content.Contains("CoordinatorServiceStampUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampUri = (string) content.GetValueForProperty("CoordinatorServiceStampUri",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampUri, global::System.Convert.ToString); + } + if (content.Contains("ProtectionServiceStampId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampId = (string) content.GetValueForProperty("ProtectionServiceStampId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionServiceStampUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampUri = (string) content.GetValueForProperty("ProtectionServiceStampUri",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampUri, global::System.Convert.ToString); + } + if (content.Contains("TokenExtendedInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).TokenExtendedInformation = (string) content.GetValueForProperty("TokenExtendedInformation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).TokenExtendedInformation, global::System.Convert.ToString); + } + if (content.Contains("RpTierInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpTierInformation = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation) content.GetValueForProperty("RpTierInformation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpTierInformation, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenRpTierInformationTypeConverter.ConvertFrom); + } + if (content.Contains("RpOriginalSaOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpOriginalSaOption = (bool?) content.GetValueForProperty("RpOriginalSaOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpOriginalSaOption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RpIsManagedVirtualMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpIsManagedVirtualMachine = (bool?) content.GetValueForProperty("RpIsManagedVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpIsManagedVirtualMachine, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RpVMSizeDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpVMSizeDescription = (string) content.GetValueForProperty("RpVMSizeDescription",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpVMSizeDescription, global::System.Convert.ToString); + } + if (content.Contains("BmsActiveRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BmsActiveRegion = (string) content.GetValueForProperty("BmsActiveRegion",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BmsActiveRegion, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CrrAccessToken(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CrrAccessToken(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(CrrAccessTokenTypeConverter))] + public partial interface ICrrAccessToken + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessToken.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessToken.TypeConverter.cs new file mode 100644 index 000000000000..a0f4f5c4e337 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessToken.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CrrAccessTokenTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CrrAccessToken.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CrrAccessToken.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CrrAccessToken.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessToken.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessToken.cs new file mode 100644 index 000000000000..b3840795d79c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessToken.cs @@ -0,0 +1,473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class CrrAccessToken : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal + { + + /// Backing field for property. + private string _accessTokenString; + + /// Access token used for authentication + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string AccessTokenString { get => this._accessTokenString; set => this._accessTokenString = value; } + + /// Backing field for property. + private string _backupManagementType; + + /// Backup Management Type + [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 _bmsActiveRegion; + + /// Active region name of BMS Stamp + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string BmsActiveRegion { get => this._bmsActiveRegion; set => this._bmsActiveRegion = value; } + + /// Backing field for property. + private string _containerName; + + /// Container Unique name + [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; + + /// Container Type + [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 _coordinatorServiceStampId; + + /// CoordinatorServiceStampId to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string CoordinatorServiceStampId { get => this._coordinatorServiceStampId; set => this._coordinatorServiceStampId = value; } + + /// Backing field for property. + private string _coordinatorServiceStampUri; + + /// CoordinatorServiceStampUri to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string CoordinatorServiceStampUri { get => this._coordinatorServiceStampUri; set => this._coordinatorServiceStampUri = value; } + + /// Backing field for property. + private string _datasourceContainerName; + + /// Datasource Container Unique Name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DatasourceContainerName { get => this._datasourceContainerName; set => this._datasourceContainerName = value; } + + /// Backing field for property. + private string _datasourceId; + + /// Datasource Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DatasourceId { get => this._datasourceId; set => this._datasourceId = value; } + + /// Backing field for property. + private string _datasourceName; + + /// Datasource Friendly Name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DatasourceName { get => this._datasourceName; set => this._datasourceName = value; } + + /// Backing field for property. + private string _datasourceType; + + /// Datasource Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DatasourceType { get => this._datasourceType; set => this._datasourceType = value; } + + /// Backing field for property. + private string _objectType; + + /// Type of the specific object - used for deserializing + [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 long? _protectionContainerId; + + /// Protected item container id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public long? ProtectionContainerId { get => this._protectionContainerId; set => this._protectionContainerId = value; } + + /// Backing field for property. + private string _protectionServiceStampId; + + /// ProtectionServiceStampId to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectionServiceStampId { get => this._protectionServiceStampId; set => this._protectionServiceStampId = value; } + + /// Backing field for property. + private string _protectionServiceStampUri; + + /// ProtectionServiceStampUri to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectionServiceStampUri { get => this._protectionServiceStampUri; set => this._protectionServiceStampUri = 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 _recoveryPointTime; + + /// Recovery Point Time + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RecoveryPointTime { get => this._recoveryPointTime; set => this._recoveryPointTime = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// Resource Group name of the source vault + [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 _resourceId; + + /// Resource Id of the source vault + [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 string _resourceName; + + /// Resource Name of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private bool? _rpIsManagedVirtualMachine; + + /// Recovery point information: Managed virtual machine + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? RpIsManagedVirtualMachine { get => this._rpIsManagedVirtualMachine; set => this._rpIsManagedVirtualMachine = value; } + + /// Backing field for property. + private bool? _rpOriginalSaOption; + + /// Recovery point information: Original SA option + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? RpOriginalSaOption { get => this._rpOriginalSaOption; set => this._rpOriginalSaOption = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation _rpTierInformation; + + /// Recovery point Tier Information + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation RpTierInformation { get => (this._rpTierInformation = this._rpTierInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenRpTierInformation()); set => this._rpTierInformation = value; } + + /// Backing field for property. + private string _rpVMSizeDescription; + + /// Recovery point information: VM size description + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RpVMSizeDescription { get => this._rpVMSizeDescription; set => this._rpVMSizeDescription = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription Id of the source vault + [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 _tokenExtendedInformation; + + /// Extended Information about the token like FileSpec etc. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string TokenExtendedInformation { get => this._tokenExtendedInformation; set => this._tokenExtendedInformation = value; } + + /// Creates an new instance. + public CrrAccessToken() + { + + } + } + public partial interface ICrrAccessToken : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Access token used for authentication + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access token used for authentication", + SerializedName = @"accessTokenString", + PossibleTypes = new [] { typeof(string) })] + string AccessTokenString { get; set; } + /// Backup Management Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup Management Type", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(string) })] + string BackupManagementType { get; set; } + /// Active region name of BMS Stamp + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Active region name of BMS Stamp", + SerializedName = @"bMSActiveRegion", + PossibleTypes = new [] { typeof(string) })] + string BmsActiveRegion { get; set; } + /// Container Unique name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Container Unique name", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// Container Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Container Type", + SerializedName = @"containerType", + PossibleTypes = new [] { typeof(string) })] + string ContainerType { get; set; } + /// CoordinatorServiceStampId to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"CoordinatorServiceStampId to be used by BCM in restore call", + SerializedName = @"coordinatorServiceStampId", + PossibleTypes = new [] { typeof(string) })] + string CoordinatorServiceStampId { get; set; } + /// CoordinatorServiceStampUri to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"CoordinatorServiceStampUri to be used by BCM in restore call", + SerializedName = @"coordinatorServiceStampUri", + PossibleTypes = new [] { typeof(string) })] + string CoordinatorServiceStampUri { get; set; } + /// Datasource Container Unique Name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Datasource Container Unique Name", + SerializedName = @"datasourceContainerName", + PossibleTypes = new [] { typeof(string) })] + string DatasourceContainerName { get; set; } + /// Datasource Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Datasource Id", + SerializedName = @"datasourceId", + PossibleTypes = new [] { typeof(string) })] + string DatasourceId { get; set; } + /// Datasource Friendly Name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Datasource Friendly Name", + SerializedName = @"datasourceName", + PossibleTypes = new [] { typeof(string) })] + string DatasourceName { get; set; } + /// Datasource Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Datasource Type", + SerializedName = @"datasourceType", + PossibleTypes = new [] { typeof(string) })] + string DatasourceType { get; set; } + /// Type of the specific object - used for deserializing + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of the specific object - used for deserializing", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + /// Protected item container id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protected item container id", + SerializedName = @"protectionContainerId", + PossibleTypes = new [] { typeof(long) })] + long? ProtectionContainerId { get; set; } + /// ProtectionServiceStampId to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ProtectionServiceStampId to be used by BCM in restore call", + SerializedName = @"protectionServiceStampId", + PossibleTypes = new [] { typeof(string) })] + string ProtectionServiceStampId { get; set; } + /// ProtectionServiceStampUri to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ProtectionServiceStampUri to be used by BCM in restore call", + SerializedName = @"protectionServiceStampUri", + PossibleTypes = new [] { typeof(string) })] + string ProtectionServiceStampUri { get; set; } + /// 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; } + /// Recovery Point Time + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery Point Time", + SerializedName = @"recoveryPointTime", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointTime { get; set; } + /// Resource Group name of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Group name of the source vault", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroupName { get; set; } + /// Resource Id of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the source vault", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// Resource Name of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Name of the source vault", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + string ResourceName { get; set; } + /// Recovery point information: Managed virtual machine + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery point information: Managed virtual machine", + SerializedName = @"rpIsManagedVirtualMachine", + PossibleTypes = new [] { typeof(bool) })] + bool? RpIsManagedVirtualMachine { get; set; } + /// Recovery point information: Original SA option + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery point information: Original SA option", + SerializedName = @"rpOriginalSAOption", + PossibleTypes = new [] { typeof(bool) })] + bool? RpOriginalSaOption { get; set; } + /// Recovery point Tier Information + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery point Tier Information", + SerializedName = @"rpTierInformation", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation RpTierInformation { get; set; } + /// Recovery point information: VM size description + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery point information: VM size description", + SerializedName = @"rpVMSizeDescription", + PossibleTypes = new [] { typeof(string) })] + string RpVMSizeDescription { get; set; } + /// Subscription Id of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription Id of the source vault", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + /// Extended Information about the token like FileSpec etc. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Extended Information about the token like FileSpec etc.", + SerializedName = @"tokenExtendedInformation", + PossibleTypes = new [] { typeof(string) })] + string TokenExtendedInformation { get; set; } + + } + internal partial interface ICrrAccessTokenInternal + + { + /// Access token used for authentication + string AccessTokenString { get; set; } + /// Backup Management Type + string BackupManagementType { get; set; } + /// Active region name of BMS Stamp + string BmsActiveRegion { get; set; } + /// Container Unique name + string ContainerName { get; set; } + /// Container Type + string ContainerType { get; set; } + /// CoordinatorServiceStampId to be used by BCM in restore call + string CoordinatorServiceStampId { get; set; } + /// CoordinatorServiceStampUri to be used by BCM in restore call + string CoordinatorServiceStampUri { get; set; } + /// Datasource Container Unique Name + string DatasourceContainerName { get; set; } + /// Datasource Id + string DatasourceId { get; set; } + /// Datasource Friendly Name + string DatasourceName { get; set; } + /// Datasource Type + string DatasourceType { get; set; } + /// Type of the specific object - used for deserializing + string ObjectType { get; set; } + /// Protected item container id + long? ProtectionContainerId { get; set; } + /// ProtectionServiceStampId to be used by BCM in restore call + string ProtectionServiceStampId { get; set; } + /// ProtectionServiceStampUri to be used by BCM in restore call + string ProtectionServiceStampUri { get; set; } + /// Recovery Point Id + string RecoveryPointId { get; set; } + /// Recovery Point Time + string RecoveryPointTime { get; set; } + /// Resource Group name of the source vault + string ResourceGroupName { get; set; } + /// Resource Id of the source vault + string ResourceId { get; set; } + /// Resource Name of the source vault + string ResourceName { get; set; } + /// Recovery point information: Managed virtual machine + bool? RpIsManagedVirtualMachine { get; set; } + /// Recovery point information: Original SA option + bool? RpOriginalSaOption { get; set; } + /// Recovery point Tier Information + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation RpTierInformation { get; set; } + /// Recovery point information: VM size description + string RpVMSizeDescription { get; set; } + /// Subscription Id of the source vault + string SubscriptionId { get; set; } + /// Extended Information about the token like FileSpec etc. + string TokenExtendedInformation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessToken.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessToken.json.cs new file mode 100644 index 000000000000..c1e2a1b770f8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessToken.json.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class CrrAccessToken + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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 CrrAccessToken(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;} + {_accessTokenString = If( json?.PropertyT("accessTokenString"), out var __jsonAccessTokenString) ? (string)__jsonAccessTokenString : (string)AccessTokenString;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} + {_resourceName = If( json?.PropertyT("resourceName"), out var __jsonResourceName) ? (string)__jsonResourceName : (string)ResourceName;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_protectionContainerId = If( json?.PropertyT("protectionContainerId"), out var __jsonProtectionContainerId) ? (long?)__jsonProtectionContainerId : ProtectionContainerId;} + {_recoveryPointId = If( json?.PropertyT("recoveryPointId"), out var __jsonRecoveryPointId) ? (string)__jsonRecoveryPointId : (string)RecoveryPointId;} + {_recoveryPointTime = If( json?.PropertyT("recoveryPointTime"), out var __jsonRecoveryPointTime) ? (string)__jsonRecoveryPointTime : (string)RecoveryPointTime;} + {_containerName = If( json?.PropertyT("containerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + {_containerType = If( json?.PropertyT("containerType"), out var __jsonContainerType) ? (string)__jsonContainerType : (string)ContainerType;} + {_backupManagementType = If( json?.PropertyT("backupManagementType"), out var __jsonBackupManagementType) ? (string)__jsonBackupManagementType : (string)BackupManagementType;} + {_datasourceType = If( json?.PropertyT("datasourceType"), out var __jsonDatasourceType) ? (string)__jsonDatasourceType : (string)DatasourceType;} + {_datasourceName = If( json?.PropertyT("datasourceName"), out var __jsonDatasourceName) ? (string)__jsonDatasourceName : (string)DatasourceName;} + {_datasourceId = If( json?.PropertyT("datasourceId"), out var __jsonDatasourceId) ? (string)__jsonDatasourceId : (string)DatasourceId;} + {_datasourceContainerName = If( json?.PropertyT("datasourceContainerName"), out var __jsonDatasourceContainerName) ? (string)__jsonDatasourceContainerName : (string)DatasourceContainerName;} + {_coordinatorServiceStampId = If( json?.PropertyT("coordinatorServiceStampId"), out var __jsonCoordinatorServiceStampId) ? (string)__jsonCoordinatorServiceStampId : (string)CoordinatorServiceStampId;} + {_coordinatorServiceStampUri = If( json?.PropertyT("coordinatorServiceStampUri"), out var __jsonCoordinatorServiceStampUri) ? (string)__jsonCoordinatorServiceStampUri : (string)CoordinatorServiceStampUri;} + {_protectionServiceStampId = If( json?.PropertyT("protectionServiceStampId"), out var __jsonProtectionServiceStampId) ? (string)__jsonProtectionServiceStampId : (string)ProtectionServiceStampId;} + {_protectionServiceStampUri = If( json?.PropertyT("protectionServiceStampUri"), out var __jsonProtectionServiceStampUri) ? (string)__jsonProtectionServiceStampUri : (string)ProtectionServiceStampUri;} + {_tokenExtendedInformation = If( json?.PropertyT("tokenExtendedInformation"), out var __jsonTokenExtendedInformation) ? (string)__jsonTokenExtendedInformation : (string)TokenExtendedInformation;} + {_rpTierInformation = If( json?.PropertyT("rpTierInformation"), out var __jsonRpTierInformation) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenRpTierInformation.FromJson(__jsonRpTierInformation) : RpTierInformation;} + {_rpOriginalSaOption = If( json?.PropertyT("rpOriginalSAOption"), out var __jsonRpOriginalSaOption) ? (bool?)__jsonRpOriginalSaOption : RpOriginalSaOption;} + {_rpIsManagedVirtualMachine = If( json?.PropertyT("rpIsManagedVirtualMachine"), out var __jsonRpIsManagedVirtualMachine) ? (bool?)__jsonRpIsManagedVirtualMachine : RpIsManagedVirtualMachine;} + {_rpVMSizeDescription = If( json?.PropertyT("rpVMSizeDescription"), out var __jsonRpVMSizeDescription) ? (string)__jsonRpVMSizeDescription : (string)RpVMSizeDescription;} + {_bmsActiveRegion = If( json?.PropertyT("bMSActiveRegion"), out var __jsonBMSActiveRegion) ? (string)__jsonBMSActiveRegion : (string)BmsActiveRegion;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken 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.Api20241115.ICrrAccessToken. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken 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 "WorkloadCrrAccessToken": + { + return new WorkloadCrrAccessToken(json); + } + } + return new CrrAccessToken(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._accessTokenString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._accessTokenString.ToString()) : null, "accessTokenString" ,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._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._resourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._resourceName.ToString()) : null, "resourceName" ,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 != this._protectionContainerId ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNumber((long)this._protectionContainerId) : null, "protectionContainerId" ,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._recoveryPointTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._recoveryPointTime.ToString()) : null, "recoveryPointTime" ,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._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._datasourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._datasourceType.ToString()) : null, "datasourceType" ,container.Add ); + AddIf( null != (((object)this._datasourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._datasourceName.ToString()) : null, "datasourceName" ,container.Add ); + AddIf( null != (((object)this._datasourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._datasourceId.ToString()) : null, "datasourceId" ,container.Add ); + AddIf( null != (((object)this._datasourceContainerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._datasourceContainerName.ToString()) : null, "datasourceContainerName" ,container.Add ); + AddIf( null != (((object)this._coordinatorServiceStampId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._coordinatorServiceStampId.ToString()) : null, "coordinatorServiceStampId" ,container.Add ); + AddIf( null != (((object)this._coordinatorServiceStampUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._coordinatorServiceStampUri.ToString()) : null, "coordinatorServiceStampUri" ,container.Add ); + AddIf( null != (((object)this._protectionServiceStampId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionServiceStampId.ToString()) : null, "protectionServiceStampId" ,container.Add ); + AddIf( null != (((object)this._protectionServiceStampUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectionServiceStampUri.ToString()) : null, "protectionServiceStampUri" ,container.Add ); + AddIf( null != (((object)this._tokenExtendedInformation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._tokenExtendedInformation.ToString()) : null, "tokenExtendedInformation" ,container.Add ); + AddIf( null != this._rpTierInformation ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._rpTierInformation.ToJson(null,serializationMode) : null, "rpTierInformation" ,container.Add ); + AddIf( null != this._rpOriginalSaOption ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._rpOriginalSaOption) : null, "rpOriginalSAOption" ,container.Add ); + AddIf( null != this._rpIsManagedVirtualMachine ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._rpIsManagedVirtualMachine) : null, "rpIsManagedVirtualMachine" ,container.Add ); + AddIf( null != (((object)this._rpVMSizeDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._rpVMSizeDescription.ToString()) : null, "rpVMSizeDescription" ,container.Add ); + AddIf( null != (((object)this._bmsActiveRegion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._bmsActiveRegion.ToString()) : null, "bMSActiveRegion" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenResource.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenResource.PowerShell.cs new file mode 100644 index 000000000000..764f122d6589 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenResource.PowerShell.cs @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(CrrAccessTokenResourceTypeConverter))] + public partial class CrrAccessTokenResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CrrAccessTokenResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("AccessTokenString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).AccessTokenString = (string) content.GetValueForProperty("AccessTokenString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).AccessTokenString, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ProtectionContainerId = (long?) content.GetValueForProperty("ProtectionContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ProtectionContainerId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RecoveryPointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RecoveryPointId = (string) content.GetValueForProperty("RecoveryPointId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RecoveryPointId, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RecoveryPointTime = (string) content.GetValueForProperty("RecoveryPointTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RecoveryPointTime, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("ContainerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ContainerType = (string) content.GetValueForProperty("ContainerType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ContainerType, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).BackupManagementType = (string) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).BackupManagementType, global::System.Convert.ToString); + } + if (content.Contains("DatasourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceType = (string) content.GetValueForProperty("DatasourceType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceType, global::System.Convert.ToString); + } + if (content.Contains("DatasourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceName = (string) content.GetValueForProperty("DatasourceName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceName, global::System.Convert.ToString); + } + if (content.Contains("DatasourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceId = (string) content.GetValueForProperty("DatasourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceId, global::System.Convert.ToString); + } + if (content.Contains("DatasourceContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceContainerName = (string) content.GetValueForProperty("DatasourceContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceContainerName, global::System.Convert.ToString); + } + if (content.Contains("CoordinatorServiceStampId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).CoordinatorServiceStampId = (string) content.GetValueForProperty("CoordinatorServiceStampId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).CoordinatorServiceStampId, global::System.Convert.ToString); + } + if (content.Contains("CoordinatorServiceStampUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).CoordinatorServiceStampUri = (string) content.GetValueForProperty("CoordinatorServiceStampUri",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).CoordinatorServiceStampUri, global::System.Convert.ToString); + } + if (content.Contains("ProtectionServiceStampId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ProtectionServiceStampId = (string) content.GetValueForProperty("ProtectionServiceStampId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ProtectionServiceStampId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionServiceStampUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ProtectionServiceStampUri = (string) content.GetValueForProperty("ProtectionServiceStampUri",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ProtectionServiceStampUri, global::System.Convert.ToString); + } + if (content.Contains("TokenExtendedInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).TokenExtendedInformation = (string) content.GetValueForProperty("TokenExtendedInformation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).TokenExtendedInformation, global::System.Convert.ToString); + } + if (content.Contains("RpTierInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpTierInformation = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation) content.GetValueForProperty("RpTierInformation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpTierInformation, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenRpTierInformationTypeConverter.ConvertFrom); + } + if (content.Contains("RpOriginalSaOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpOriginalSaOption = (bool?) content.GetValueForProperty("RpOriginalSaOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpOriginalSaOption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RpIsManagedVirtualMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpIsManagedVirtualMachine = (bool?) content.GetValueForProperty("RpIsManagedVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpIsManagedVirtualMachine, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RpVMSizeDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpVMSizeDescription = (string) content.GetValueForProperty("RpVMSizeDescription",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpVMSizeDescription, global::System.Convert.ToString); + } + if (content.Contains("BmsActiveRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).BmsActiveRegion = (string) content.GetValueForProperty("BmsActiveRegion",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).BmsActiveRegion, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CrrAccessTokenResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("AccessTokenString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).AccessTokenString = (string) content.GetValueForProperty("AccessTokenString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).AccessTokenString, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ProtectionContainerId = (long?) content.GetValueForProperty("ProtectionContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ProtectionContainerId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RecoveryPointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RecoveryPointId = (string) content.GetValueForProperty("RecoveryPointId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RecoveryPointId, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RecoveryPointTime = (string) content.GetValueForProperty("RecoveryPointTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RecoveryPointTime, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("ContainerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ContainerType = (string) content.GetValueForProperty("ContainerType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ContainerType, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).BackupManagementType = (string) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).BackupManagementType, global::System.Convert.ToString); + } + if (content.Contains("DatasourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceType = (string) content.GetValueForProperty("DatasourceType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceType, global::System.Convert.ToString); + } + if (content.Contains("DatasourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceName = (string) content.GetValueForProperty("DatasourceName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceName, global::System.Convert.ToString); + } + if (content.Contains("DatasourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceId = (string) content.GetValueForProperty("DatasourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceId, global::System.Convert.ToString); + } + if (content.Contains("DatasourceContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceContainerName = (string) content.GetValueForProperty("DatasourceContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).DatasourceContainerName, global::System.Convert.ToString); + } + if (content.Contains("CoordinatorServiceStampId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).CoordinatorServiceStampId = (string) content.GetValueForProperty("CoordinatorServiceStampId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).CoordinatorServiceStampId, global::System.Convert.ToString); + } + if (content.Contains("CoordinatorServiceStampUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).CoordinatorServiceStampUri = (string) content.GetValueForProperty("CoordinatorServiceStampUri",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).CoordinatorServiceStampUri, global::System.Convert.ToString); + } + if (content.Contains("ProtectionServiceStampId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ProtectionServiceStampId = (string) content.GetValueForProperty("ProtectionServiceStampId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ProtectionServiceStampId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionServiceStampUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ProtectionServiceStampUri = (string) content.GetValueForProperty("ProtectionServiceStampUri",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).ProtectionServiceStampUri, global::System.Convert.ToString); + } + if (content.Contains("TokenExtendedInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).TokenExtendedInformation = (string) content.GetValueForProperty("TokenExtendedInformation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).TokenExtendedInformation, global::System.Convert.ToString); + } + if (content.Contains("RpTierInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpTierInformation = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation) content.GetValueForProperty("RpTierInformation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpTierInformation, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenRpTierInformationTypeConverter.ConvertFrom); + } + if (content.Contains("RpOriginalSaOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpOriginalSaOption = (bool?) content.GetValueForProperty("RpOriginalSaOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpOriginalSaOption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RpIsManagedVirtualMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpIsManagedVirtualMachine = (bool?) content.GetValueForProperty("RpIsManagedVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpIsManagedVirtualMachine, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RpVMSizeDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpVMSizeDescription = (string) content.GetValueForProperty("RpVMSizeDescription",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).RpVMSizeDescription, global::System.Convert.ToString); + } + if (content.Contains("BmsActiveRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).BmsActiveRegion = (string) content.GetValueForProperty("BmsActiveRegion",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal)this).BmsActiveRegion, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CrrAccessTokenResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CrrAccessTokenResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(CrrAccessTokenResourceTypeConverter))] + public partial interface ICrrAccessTokenResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenResource.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenResource.TypeConverter.cs new file mode 100644 index 000000000000..8d2a8945d1d9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenResource.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CrrAccessTokenResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CrrAccessTokenResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CrrAccessTokenResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CrrAccessTokenResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenResource.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenResource.cs new file mode 100644 index 000000000000..ce6615aec5ac --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenResource.cs @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class CrrAccessTokenResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.Resource(); + + /// Access token used for authentication + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string AccessTokenString { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).AccessTokenString; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).AccessTokenString = value ?? null; } + + /// Backup Management Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).BackupManagementType = value ?? null; } + + /// Active region name of BMS Stamp + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string BmsActiveRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).BmsActiveRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).BmsActiveRegion = value ?? null; } + + /// Container Unique name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ContainerName = value ?? null; } + + /// Container Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ContainerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ContainerType = value ?? null; } + + /// CoordinatorServiceStampId to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string CoordinatorServiceStampId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).CoordinatorServiceStampId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).CoordinatorServiceStampId = value ?? null; } + + /// CoordinatorServiceStampUri to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string CoordinatorServiceStampUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).CoordinatorServiceStampUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).CoordinatorServiceStampUri = value ?? null; } + + /// Datasource Container Unique Name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string DatasourceContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).DatasourceContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).DatasourceContainerName = value ?? null; } + + /// Datasource Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string DatasourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).DatasourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).DatasourceId = value ?? null; } + + /// Datasource Friendly Name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string DatasourceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).DatasourceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).DatasourceName = value ?? null; } + + /// Datasource Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string DatasourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).DatasourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).DatasourceType = 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.Api20241115.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessToken()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).Name; } + + /// Type of the specific object - used for deserializing + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ObjectType = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken _property; + + /// CrrAccessTokenResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessToken()); set => this._property = value; } + + /// Protected item container id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public long? ProtectionContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ProtectionContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ProtectionContainerId = value ?? default(long); } + + /// ProtectionServiceStampId to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ProtectionServiceStampId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ProtectionServiceStampId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ProtectionServiceStampId = value ?? null; } + + /// ProtectionServiceStampUri to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ProtectionServiceStampUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ProtectionServiceStampUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ProtectionServiceStampUri = value ?? null; } + + /// Recovery Point Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RecoveryPointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).RecoveryPointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).RecoveryPointId = value ?? null; } + + /// Recovery Point Time + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RecoveryPointTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).RecoveryPointTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).RecoveryPointTime = value ?? null; } + + /// Resource Group name of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ResourceGroupName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ResourceGroupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ResourceGroupName = value ?? null; } + + /// Resource Id of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ResourceId = value ?? null; } + + /// Resource Name of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ResourceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ResourceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).ResourceName = value ?? null; } + + /// Recovery point information: Managed virtual machine + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? RpIsManagedVirtualMachine { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).RpIsManagedVirtualMachine; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).RpIsManagedVirtualMachine = value ?? default(bool); } + + /// Recovery point information: Original SA option + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? RpOriginalSaOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).RpOriginalSaOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).RpOriginalSaOption = value ?? default(bool); } + + /// Recovery point Tier Information + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation RpTierInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).RpTierInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).RpTierInformation = value ?? null /* model class */; } + + /// Recovery point information: VM size description + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RpVMSizeDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).RpVMSizeDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).RpVMSizeDescription = value ?? null; } + + /// Subscription Id of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)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.Api20241115.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// Extended Information about the token like FileSpec etc. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string TokenExtendedInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).TokenExtendedInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)Property).TokenExtendedInformation = value ?? null; } + + /// + /// 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.Api20241115.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public CrrAccessTokenResource() + { + + } + + /// 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 ICrrAccessTokenResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource + { + /// Access token used for authentication + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access token used for authentication", + SerializedName = @"accessTokenString", + PossibleTypes = new [] { typeof(string) })] + string AccessTokenString { get; set; } + /// Backup Management Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backup Management Type", + SerializedName = @"backupManagementType", + PossibleTypes = new [] { typeof(string) })] + string BackupManagementType { get; set; } + /// Active region name of BMS Stamp + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Active region name of BMS Stamp", + SerializedName = @"bMSActiveRegion", + PossibleTypes = new [] { typeof(string) })] + string BmsActiveRegion { get; set; } + /// Container Unique name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Container Unique name", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// Container Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Container Type", + SerializedName = @"containerType", + PossibleTypes = new [] { typeof(string) })] + string ContainerType { get; set; } + /// CoordinatorServiceStampId to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"CoordinatorServiceStampId to be used by BCM in restore call", + SerializedName = @"coordinatorServiceStampId", + PossibleTypes = new [] { typeof(string) })] + string CoordinatorServiceStampId { get; set; } + /// CoordinatorServiceStampUri to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"CoordinatorServiceStampUri to be used by BCM in restore call", + SerializedName = @"coordinatorServiceStampUri", + PossibleTypes = new [] { typeof(string) })] + string CoordinatorServiceStampUri { get; set; } + /// Datasource Container Unique Name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Datasource Container Unique Name", + SerializedName = @"datasourceContainerName", + PossibleTypes = new [] { typeof(string) })] + string DatasourceContainerName { get; set; } + /// Datasource Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Datasource Id", + SerializedName = @"datasourceId", + PossibleTypes = new [] { typeof(string) })] + string DatasourceId { get; set; } + /// Datasource Friendly Name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Datasource Friendly Name", + SerializedName = @"datasourceName", + PossibleTypes = new [] { typeof(string) })] + string DatasourceName { get; set; } + /// Datasource Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Datasource Type", + SerializedName = @"datasourceType", + PossibleTypes = new [] { typeof(string) })] + string DatasourceType { get; set; } + /// Type of the specific object - used for deserializing + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the specific object - used for deserializing", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + /// Protected item container id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Protected item container id", + SerializedName = @"protectionContainerId", + PossibleTypes = new [] { typeof(long) })] + long? ProtectionContainerId { get; set; } + /// ProtectionServiceStampId to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ProtectionServiceStampId to be used by BCM in restore call", + SerializedName = @"protectionServiceStampId", + PossibleTypes = new [] { typeof(string) })] + string ProtectionServiceStampId { get; set; } + /// ProtectionServiceStampUri to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ProtectionServiceStampUri to be used by BCM in restore call", + SerializedName = @"protectionServiceStampUri", + PossibleTypes = new [] { typeof(string) })] + string ProtectionServiceStampUri { get; set; } + /// 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; } + /// Recovery Point Time + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery Point Time", + SerializedName = @"recoveryPointTime", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointTime { get; set; } + /// Resource Group name of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Group name of the source vault", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroupName { get; set; } + /// Resource Id of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the source vault", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// Resource Name of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Name of the source vault", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + string ResourceName { get; set; } + /// Recovery point information: Managed virtual machine + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery point information: Managed virtual machine", + SerializedName = @"rpIsManagedVirtualMachine", + PossibleTypes = new [] { typeof(bool) })] + bool? RpIsManagedVirtualMachine { get; set; } + /// Recovery point information: Original SA option + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery point information: Original SA option", + SerializedName = @"rpOriginalSAOption", + PossibleTypes = new [] { typeof(bool) })] + bool? RpOriginalSaOption { get; set; } + /// Recovery point Tier Information + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery point Tier Information", + SerializedName = @"rpTierInformation", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation RpTierInformation { get; set; } + /// Recovery point information: VM size description + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recovery point information: VM size description", + SerializedName = @"rpVMSizeDescription", + PossibleTypes = new [] { typeof(string) })] + string RpVMSizeDescription { get; set; } + /// Subscription Id of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription Id of the source vault", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + /// Extended Information about the token like FileSpec etc. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Extended Information about the token like FileSpec etc.", + SerializedName = @"tokenExtendedInformation", + PossibleTypes = new [] { typeof(string) })] + string TokenExtendedInformation { get; set; } + + } + internal partial interface ICrrAccessTokenResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal + { + /// Access token used for authentication + string AccessTokenString { get; set; } + /// Backup Management Type + string BackupManagementType { get; set; } + /// Active region name of BMS Stamp + string BmsActiveRegion { get; set; } + /// Container Unique name + string ContainerName { get; set; } + /// Container Type + string ContainerType { get; set; } + /// CoordinatorServiceStampId to be used by BCM in restore call + string CoordinatorServiceStampId { get; set; } + /// CoordinatorServiceStampUri to be used by BCM in restore call + string CoordinatorServiceStampUri { get; set; } + /// Datasource Container Unique Name + string DatasourceContainerName { get; set; } + /// Datasource Id + string DatasourceId { get; set; } + /// Datasource Friendly Name + string DatasourceName { get; set; } + /// Datasource Type + string DatasourceType { get; set; } + /// Type of the specific object - used for deserializing + string ObjectType { get; set; } + /// CrrAccessTokenResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken Property { get; set; } + /// Protected item container id + long? ProtectionContainerId { get; set; } + /// ProtectionServiceStampId to be used by BCM in restore call + string ProtectionServiceStampId { get; set; } + /// ProtectionServiceStampUri to be used by BCM in restore call + string ProtectionServiceStampUri { get; set; } + /// Recovery Point Id + string RecoveryPointId { get; set; } + /// Recovery Point Time + string RecoveryPointTime { get; set; } + /// Resource Group name of the source vault + string ResourceGroupName { get; set; } + /// Resource Id of the source vault + string ResourceId { get; set; } + /// Resource Name of the source vault + string ResourceName { get; set; } + /// Recovery point information: Managed virtual machine + bool? RpIsManagedVirtualMachine { get; set; } + /// Recovery point information: Original SA option + bool? RpOriginalSaOption { get; set; } + /// Recovery point Tier Information + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation RpTierInformation { get; set; } + /// Recovery point information: VM size description + string RpVMSizeDescription { get; set; } + /// Subscription Id of the source vault + string SubscriptionId { get; set; } + /// Extended Information about the token like FileSpec etc. + string TokenExtendedInformation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenResource.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenResource.json.cs new file mode 100644 index 000000000000..9e2f4a168617 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenResource.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class CrrAccessTokenResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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 CrrAccessTokenResource(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.Api20241115.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessToken.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new CrrAccessTokenResource(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.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenRpTierInformation.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenRpTierInformation.PowerShell.cs new file mode 100644 index 000000000000..716e5dbcc4f1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenRpTierInformation.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Recovery point Tier Information + [System.ComponentModel.TypeConverter(typeof(CrrAccessTokenRpTierInformationTypeConverter))] + public partial class CrrAccessTokenRpTierInformation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CrrAccessTokenRpTierInformation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CrrAccessTokenRpTierInformation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CrrAccessTokenRpTierInformation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CrrAccessTokenRpTierInformation(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Recovery point Tier Information + [System.ComponentModel.TypeConverter(typeof(CrrAccessTokenRpTierInformationTypeConverter))] + public partial interface ICrrAccessTokenRpTierInformation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenRpTierInformation.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenRpTierInformation.TypeConverter.cs new file mode 100644 index 000000000000..91f7a4057fc5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenRpTierInformation.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CrrAccessTokenRpTierInformationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CrrAccessTokenRpTierInformation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CrrAccessTokenRpTierInformation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CrrAccessTokenRpTierInformation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenRpTierInformation.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenRpTierInformation.cs new file mode 100644 index 000000000000..499d1ac4365f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenRpTierInformation.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point Tier Information + public partial class CrrAccessTokenRpTierInformation : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformationInternal + { + + /// Creates an new instance. + public CrrAccessTokenRpTierInformation() + { + + } + } + /// Recovery point Tier Information + public partial interface ICrrAccessTokenRpTierInformation : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IAssociativeArray + { + + } + /// Recovery point Tier Information + internal partial interface ICrrAccessTokenRpTierInformationInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenRpTierInformation.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenRpTierInformation.dictionary.cs new file mode 100644 index 000000000000..322ee51f24fb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenRpTierInformation.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class CrrAccessTokenRpTierInformation : + 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.Api20241115.CrrAccessTokenRpTierInformation source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenRpTierInformation.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenRpTierInformation.json.cs new file mode 100644 index 000000000000..83805375318e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrAccessTokenRpTierInformation.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point Tier Information + public partial class CrrAccessTokenRpTierInformation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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 CrrAccessTokenRpTierInformation(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.Api20241115.ICrrAccessTokenRpTierInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new CrrAccessTokenRpTierInformation(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.DefaultTag/generated/api/Models/Api20241115/CrrJobRequest.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequest.PowerShell.cs new file mode 100644 index 000000000000..b2ed0e5c275d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequest.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Request object for fetching CRR jobs. + [System.ComponentModel.TypeConverter(typeof(CrrJobRequestTypeConverter))] + public partial class CrrJobRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CrrJobRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("JobName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestInternal)this).JobName = (string) content.GetValueForProperty("JobName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestInternal)this).JobName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CrrJobRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("JobName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestInternal)this).JobName = (string) content.GetValueForProperty("JobName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestInternal)this).JobName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CrrJobRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CrrJobRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Request object for fetching CRR jobs. + [System.ComponentModel.TypeConverter(typeof(CrrJobRequestTypeConverter))] + public partial interface ICrrJobRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequest.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequest.TypeConverter.cs new file mode 100644 index 000000000000..a51ca836c2bb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequest.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CrrJobRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CrrJobRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CrrJobRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CrrJobRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequest.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequest.cs new file mode 100644 index 000000000000..4c1ca78370cd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequest.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Request object for fetching CRR jobs. + public partial class CrrJobRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestInternal + { + + /// Backing field for property. + private string _jobName; + + /// Job Name of the job 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 _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; } + + /// Creates an new instance. + public CrrJobRequest() + { + + } + } + /// Request object for fetching CRR jobs. + public partial interface ICrrJobRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Job Name of the job to be fetched + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job Name of the job to be fetched", + SerializedName = @"jobName", + PossibleTypes = new [] { typeof(string) })] + string JobName { 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; } + + } + /// Request object for fetching CRR jobs. + internal partial interface ICrrJobRequestInternal + + { + /// Job Name of the job to be fetched + string JobName { get; set; } + /// Entire ARM resource id of the resource + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequest.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequest.json.cs new file mode 100644 index 000000000000..9cd96a1eb9e2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequest.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Request object for fetching CRR jobs. + public partial class CrrJobRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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 CrrJobRequest(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_jobName = If( json?.PropertyT("jobName"), out var __jsonJobName) ? (string)__jsonJobName : (string)JobName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new CrrJobRequest(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._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._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 ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequestResource.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequestResource.PowerShell.cs new file mode 100644 index 000000000000..e1c160febf06 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequestResource.PowerShell.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Request object for fetching CRR jobs. + [System.ComponentModel.TypeConverter(typeof(CrrJobRequestResourceTypeConverter))] + public partial class CrrJobRequestResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CrrJobRequestResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrJobRequestTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResourceInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResourceInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("JobName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResourceInternal)this).JobName = (string) content.GetValueForProperty("JobName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResourceInternal)this).JobName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CrrJobRequestResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrJobRequestTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResourceInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResourceInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("JobName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResourceInternal)this).JobName = (string) content.GetValueForProperty("JobName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResourceInternal)this).JobName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CrrJobRequestResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CrrJobRequestResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Request object for fetching CRR jobs. + [System.ComponentModel.TypeConverter(typeof(CrrJobRequestResourceTypeConverter))] + public partial interface ICrrJobRequestResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequestResource.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequestResource.TypeConverter.cs new file mode 100644 index 000000000000..546560de30cb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequestResource.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CrrJobRequestResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CrrJobRequestResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CrrJobRequestResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CrrJobRequestResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequestResource.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequestResource.cs new file mode 100644 index 000000000000..49b6e15865d1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequestResource.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Request object for fetching CRR jobs. + public partial class CrrJobRequestResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).Id; } + + /// Job Name of the job to be fetched + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string JobName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestInternal)Property).JobName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestInternal)Property).JobName = 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.Api20241115.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrJobRequest()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest _property; + + /// CrrJobRequestResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrJobRequest()); set => this._property = value; } + + /// Entire ARM resource id of the resource + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestInternal)Property).ResourceId = value ?? null; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public CrrJobRequestResource() + { + + } + + /// 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); + } + } + /// Request object for fetching CRR jobs. + public partial interface ICrrJobRequestResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource + { + /// Job Name of the job to be fetched + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job Name of the job to be fetched", + SerializedName = @"jobName", + PossibleTypes = new [] { typeof(string) })] + string JobName { 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; } + + } + /// Request object for fetching CRR jobs. + internal partial interface ICrrJobRequestResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal + { + /// Job Name of the job to be fetched + string JobName { get; set; } + /// CrrJobRequestResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest Property { get; set; } + /// Entire ARM resource id of the resource + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequestResource.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequestResource.json.cs new file mode 100644 index 000000000000..e390fd50b24e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/CrrJobRequestResource.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Request object for fetching CRR jobs. + public partial class CrrJobRequestResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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 CrrJobRequestResource(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.Api20241115.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrJobRequest.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequestResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new CrrJobRequestResource(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.DefaultTag/generated/api/Models/Api20241115/DiskExclusionProperties.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskExclusionProperties.PowerShell.cs new file mode 100644 index 000000000000..df1944e3c3b4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskExclusionProperties.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(DiskExclusionPropertiesTypeConverter))] + public partial class DiskExclusionProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DiskExclusionProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DiskExclusionProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DiskExclusionProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DiskLunList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionPropertiesInternal)this).DiskLunList = (int[]) content.GetValueForProperty("DiskLunList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionPropertiesInternal)this).DiskLunList, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("IsInclusionList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionPropertiesInternal)this).IsInclusionList = (bool?) content.GetValueForProperty("IsInclusionList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionPropertiesInternal)this).IsInclusionList, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiskExclusionProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DiskLunList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionPropertiesInternal)this).DiskLunList = (int[]) content.GetValueForProperty("DiskLunList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionPropertiesInternal)this).DiskLunList, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("IsInclusionList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionPropertiesInternal)this).IsInclusionList = (bool?) content.GetValueForProperty("IsInclusionList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionPropertiesInternal)this).IsInclusionList, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(DiskExclusionPropertiesTypeConverter))] + public partial interface IDiskExclusionProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskExclusionProperties.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskExclusionProperties.TypeConverter.cs new file mode 100644 index 000000000000..647c9388a46c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskExclusionProperties.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DiskExclusionPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DiskExclusionProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DiskExclusionProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DiskExclusionProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskExclusionProperties.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskExclusionProperties.cs new file mode 100644 index 000000000000..c258069e572b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class DiskExclusionProperties : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DiskExclusionProperties.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskExclusionProperties.json.cs new file mode 100644 index 000000000000..fc76d9b2e447 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskExclusionProperties.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IDiskExclusionProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DiskInformation.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskInformation.PowerShell.cs new file mode 100644 index 000000000000..8984c718366b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskInformation.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Disk information + [System.ComponentModel.TypeConverter(typeof(DiskInformationTypeConverter))] + public partial class DiskInformation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DiskInformation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DiskInformation(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DiskInformation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Lun")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformationInternal)this).Lun = (int?) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformationInternal)this).Lun, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformationInternal)this).Name, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiskInformation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Lun")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformationInternal)this).Lun = (int?) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformationInternal)this).Lun, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformationInternal)this).Name, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Disk information + [System.ComponentModel.TypeConverter(typeof(DiskInformationTypeConverter))] + public partial interface IDiskInformation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskInformation.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskInformation.TypeConverter.cs new file mode 100644 index 000000000000..b2193a1405d4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskInformation.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DiskInformationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DiskInformation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DiskInformation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DiskInformation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskInformation.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskInformation.cs new file mode 100644 index 000000000000..bbd20dbf7744 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Disk information + public partial class DiskInformation : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DiskInformation.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskInformation.json.cs new file mode 100644 index 000000000000..ce1f328abf5b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DiskInformation.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IDiskInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DpmErrorInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmErrorInfo.PowerShell.cs new file mode 100644 index 000000000000..f39dab9bb48c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmErrorInfo.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// DPM workload-specific error information. + [System.ComponentModel.TypeConverter(typeof(DpmErrorInfoTypeConverter))] + public partial class DpmErrorInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DpmErrorInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DpmErrorInfo(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DpmErrorInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfoInternal)this).ErrorString = (string) content.GetValueForProperty("ErrorString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfoInternal)this).ErrorString, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfoInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfoInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DpmErrorInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfoInternal)this).ErrorString = (string) content.GetValueForProperty("ErrorString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfoInternal)this).ErrorString, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfoInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfoInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// DPM workload-specific error information. + [System.ComponentModel.TypeConverter(typeof(DpmErrorInfoTypeConverter))] + public partial interface IDpmErrorInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmErrorInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmErrorInfo.TypeConverter.cs new file mode 100644 index 000000000000..218ba183ecf8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmErrorInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DpmErrorInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DpmErrorInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DpmErrorInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DpmErrorInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmErrorInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmErrorInfo.cs new file mode 100644 index 000000000000..460ec266a934 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// DPM workload-specific error information. + public partial class DpmErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DpmErrorInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmErrorInfo.json.cs new file mode 100644 index 000000000000..d241b97ae33b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmErrorInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IDpmErrorInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DpmJob.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJob.PowerShell.cs new file mode 100644 index 000000000000..72edf40ac794 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJob.PowerShell.cs @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// DPM workload-specific job object. + [System.ComponentModel.TypeConverter(typeof(DpmJobTypeConverter))] + public partial class DpmJob + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJob DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DpmJob(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJob DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DpmJob(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DpmJob(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("DpmServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).DpmServerName = (string) content.GetValueForProperty("DpmServerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).DpmServerName, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("ContainerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ContainerType = (string) content.GetValueForProperty("ContainerType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ContainerType, global::System.Convert.ToString); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).WorkloadType = (string) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).WorkloadType, global::System.Convert.ToString); + } + if (content.Contains("ActionsInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ActionsInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[]) content.GetValueForProperty("ActionsInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ActionsInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction.CreateFrom)); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfo[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmErrorInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("EntityFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName = (string) content.GetValueForProperty("EntityFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActivityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId = (string) content.GetValueForProperty("ActivityId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoTasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfoTasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetails[]) content.GetValueForProperty("ExtendedInfoTasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfoTasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedInfoPropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfoPropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoPropertyBag) content.GetValueForProperty("ExtendedInfoPropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfoPropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoDynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfoDynamicErrorMessage = (string) content.GetValueForProperty("ExtendedInfoDynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfoDynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DpmJob(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("DpmServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).DpmServerName = (string) content.GetValueForProperty("DpmServerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).DpmServerName, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("ContainerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ContainerType = (string) content.GetValueForProperty("ContainerType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ContainerType, global::System.Convert.ToString); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).WorkloadType = (string) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).WorkloadType, global::System.Convert.ToString); + } + if (content.Contains("ActionsInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ActionsInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[]) content.GetValueForProperty("ActionsInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ActionsInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction.CreateFrom)); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfo[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmErrorInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("EntityFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName = (string) content.GetValueForProperty("EntityFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActivityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId = (string) content.GetValueForProperty("ActivityId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoTasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfoTasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetails[]) content.GetValueForProperty("ExtendedInfoTasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfoTasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedInfoPropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfoPropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoPropertyBag) content.GetValueForProperty("ExtendedInfoPropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfoPropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoDynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfoDynamicErrorMessage = (string) content.GetValueForProperty("ExtendedInfoDynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal)this).ExtendedInfoDynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJob FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// DPM workload-specific job object. + [System.ComponentModel.TypeConverter(typeof(DpmJobTypeConverter))] + public partial interface IDpmJob + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJob.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJob.TypeConverter.cs new file mode 100644 index 000000000000..2a8fdcb3eccc --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJob.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DpmJobTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJob ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJob).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DpmJob.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DpmJob.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DpmJob.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJob.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJob.cs new file mode 100644 index 000000000000..5ede5f5defaf --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// DPM workload-specific job object. + public partial class DpmJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJob, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJob __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).ActivityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).EntityFriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)__job).EntityFriendlyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfo[] _errorDetail; + + /// The errors. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmErrorInfo[] ErrorDetail { get => this._errorDetail; set => this._errorDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmJobExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoInternal)ExtendedInfo).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmJobTaskDetails[] ExtendedInfoTasksList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoInternal)ExtendedInfo).TasksList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoInternal)ExtendedInfo).TasksList = value ?? null /* arrayOf */; } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IDpmErrorInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IDpmErrorInfo[] ErrorDetail { get; set; } + /// Additional information for this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfo ExtendedInfo { get; set; } + /// Non localized error message on job execution. + string ExtendedInfoDynamicErrorMessage { get; set; } + /// The job properties. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks associated with this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetails[] ExtendedInfoTasksList { get; set; } + /// Type of backup item. + string WorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJob.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJob.json.cs new file mode 100644 index 000000000000..2932c430a51a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJob.json.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.Job(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmErrorInfo) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmErrorInfo.FromJson(__p) )) ))() : null : ErrorDetail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..1f0e88fa2462 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Additional information on the DPM workload-specific job. + [System.ComponentModel.TypeConverter(typeof(DpmJobExtendedInfoTypeConverter))] + public partial class DpmJobExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DpmJobExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DpmJobExtendedInfo(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DpmJobExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoInternal)this).TasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetails[]) content.GetValueForProperty("TasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoInternal)this).TasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("DynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoInternal)this).DynamicErrorMessage = (string) content.GetValueForProperty("DynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoInternal)this).DynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DpmJobExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoInternal)this).TasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetails[]) content.GetValueForProperty("TasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoInternal)this).TasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("DynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoInternal)this).DynamicErrorMessage = (string) content.GetValueForProperty("DynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoInternal)this).DynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Additional information on the DPM workload-specific job. + [System.ComponentModel.TypeConverter(typeof(DpmJobExtendedInfoTypeConverter))] + public partial interface IDpmJobExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..de11c86de8ff --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DpmJobExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DpmJobExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DpmJobExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DpmJobExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfo.cs new file mode 100644 index 000000000000..aaeaedee29c8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IDpmJobExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IDpmJobExtendedInfoPropertyBag PropertyBag { get => (this._propertyBag = this._propertyBag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobExtendedInfoPropertyBag()); set => this._propertyBag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IDpmJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmJobExtendedInfoPropertyBag PropertyBag { get; set; } + /// List of tasks associated with this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetails[] TasksList { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfo.json.cs new file mode 100644 index 000000000000..4ad3080b77be --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IDpmJobTaskDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmJobTaskDetails.FromJson(__u) )) ))() : null : TasksList;} + {_propertyBag = If( json?.PropertyT("propertyBag"), out var __jsonPropertyBag) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmJobExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfoPropertyBag.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfoPropertyBag.PowerShell.cs new file mode 100644 index 000000000000..a69a81a5476c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfoPropertyBag.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// The job properties. + [System.ComponentModel.TypeConverter(typeof(DpmJobExtendedInfoPropertyBagTypeConverter))] + public partial class DpmJobExtendedInfoPropertyBag + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoPropertyBag DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DpmJobExtendedInfoPropertyBag(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoPropertyBag DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DpmJobExtendedInfoPropertyBag(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DpmJobExtendedInfoPropertyBag(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DpmJobExtendedInfoPropertyBag(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoPropertyBag FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The job properties. + [System.ComponentModel.TypeConverter(typeof(DpmJobExtendedInfoPropertyBagTypeConverter))] + public partial interface IDpmJobExtendedInfoPropertyBag + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfoPropertyBag.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfoPropertyBag.TypeConverter.cs new file mode 100644 index 000000000000..e5f896207167 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfoPropertyBag.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DpmJobExtendedInfoPropertyBagTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoPropertyBag ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoPropertyBag).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DpmJobExtendedInfoPropertyBag.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DpmJobExtendedInfoPropertyBag.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DpmJobExtendedInfoPropertyBag.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfoPropertyBag.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfoPropertyBag.cs new file mode 100644 index 000000000000..b2c620e7bc8d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The job properties. + public partial class DpmJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoPropertyBag, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfoPropertyBag.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfoPropertyBag.dictionary.cs new file mode 100644 index 000000000000..9c24187c772f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.DpmJobExtendedInfoPropertyBag source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfoPropertyBag.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfoPropertyBag.json.cs new file mode 100644 index 000000000000..29cbfa2c5381 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobExtendedInfoPropertyBag.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IDpmJobExtendedInfoPropertyBag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobExtendedInfoPropertyBag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DpmJobTaskDetails.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobTaskDetails.PowerShell.cs new file mode 100644 index 000000000000..aa4595b75e27 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobTaskDetails.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// DPM workload-specific job task details. + [System.ComponentModel.TypeConverter(typeof(DpmJobTaskDetailsTypeConverter))] + public partial class DpmJobTaskDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DpmJobTaskDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DpmJobTaskDetails(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DpmJobTaskDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).Status, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DpmJobTaskDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetailsInternal)this).Status, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// DPM workload-specific job task details. + [System.ComponentModel.TypeConverter(typeof(DpmJobTaskDetailsTypeConverter))] + public partial interface IDpmJobTaskDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobTaskDetails.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobTaskDetails.TypeConverter.cs new file mode 100644 index 000000000000..5c5b45104eab --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobTaskDetails.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DpmJobTaskDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DpmJobTaskDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DpmJobTaskDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DpmJobTaskDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobTaskDetails.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobTaskDetails.cs new file mode 100644 index 000000000000..293d530ac300 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IDpmJobTaskDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DpmJobTaskDetails.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobTaskDetails.json.cs new file mode 100644 index 000000000000..2522222b764b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmJobTaskDetails.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IDpmJobTaskDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmJobTaskDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItem.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItem.PowerShell.cs new file mode 100644 index 000000000000..22cdf89265f3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItem.PowerShell.cs @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Additional information on Backup engine specific backup item. + [System.ComponentModel.TypeConverter(typeof(DpmProtectedItemTypeConverter))] + public partial class DpmProtectedItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DpmProtectedItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DpmProtectedItem(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DpmProtectedItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupEngineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).BackupEngineName = (string) content.GetValueForProperty("BackupEngineName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).BackupEngineName, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoProtectableObjectLoadPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoProtectableObjectLoadPath = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath) content.GetValueForProperty("ExtendedInfoProtectableObjectLoadPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoProtectableObjectLoadPath, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmProtectedItemExtendedInfoProtectableObjectLoadPathTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoProtected")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoProtected = (bool?) content.GetValueForProperty("ExtendedInfoProtected",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoProtected, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedInfoIsPresentOnCloud")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoIsPresentOnCloud = (bool?) content.GetValueForProperty("ExtendedInfoIsPresentOnCloud",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoIsPresentOnCloud, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedInfoLastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoLastBackupStatus = (string) content.GetValueForProperty("ExtendedInfoLastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoLastBackupStatus, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoLastRefreshedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoLastRefreshedAt = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoLastRefreshedAt",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoLastRefreshedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoOnPremiseOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOnPremiseOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOnPremiseOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOnPremiseOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoOnPremiseLatestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOnPremiseLatestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOnPremiseLatestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOnPremiseLatestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoOnPremiseRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOnPremiseRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoOnPremiseRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOnPremiseRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoIsCollocated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoIsCollocated = (bool?) content.GetValueForProperty("ExtendedInfoIsCollocated",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoIsCollocated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedInfoProtectionGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoProtectionGroupName = (string) content.GetValueForProperty("ExtendedInfoProtectionGroupName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoProtectionGroupName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoDiskStorageUsedInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoDiskStorageUsedInByte = (string) content.GetValueForProperty("ExtendedInfoDiskStorageUsedInByte",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoDiskStorageUsedInByte, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoTotalDiskStorageSizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoTotalDiskStorageSizeInByte = (string) content.GetValueForProperty("ExtendedInfoTotalDiskStorageSizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoTotalDiskStorageSizeInByte, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DpmProtectedItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupEngineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).BackupEngineName = (string) content.GetValueForProperty("BackupEngineName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).BackupEngineName, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemState.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoProtectableObjectLoadPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoProtectableObjectLoadPath = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath) content.GetValueForProperty("ExtendedInfoProtectableObjectLoadPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoProtectableObjectLoadPath, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmProtectedItemExtendedInfoProtectableObjectLoadPathTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoProtected")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoProtected = (bool?) content.GetValueForProperty("ExtendedInfoProtected",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoProtected, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedInfoIsPresentOnCloud")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoIsPresentOnCloud = (bool?) content.GetValueForProperty("ExtendedInfoIsPresentOnCloud",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoIsPresentOnCloud, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedInfoLastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoLastBackupStatus = (string) content.GetValueForProperty("ExtendedInfoLastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoLastBackupStatus, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoLastRefreshedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoLastRefreshedAt = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoLastRefreshedAt",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoLastRefreshedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoOnPremiseOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOnPremiseOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOnPremiseOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOnPremiseOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoOnPremiseLatestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOnPremiseLatestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOnPremiseLatestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOnPremiseLatestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoOnPremiseRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOnPremiseRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoOnPremiseRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoOnPremiseRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExtendedInfoIsCollocated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoIsCollocated = (bool?) content.GetValueForProperty("ExtendedInfoIsCollocated",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoIsCollocated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExtendedInfoProtectionGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoProtectionGroupName = (string) content.GetValueForProperty("ExtendedInfoProtectionGroupName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoProtectionGroupName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoDiskStorageUsedInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoDiskStorageUsedInByte = (string) content.GetValueForProperty("ExtendedInfoDiskStorageUsedInByte",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoDiskStorageUsedInByte, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoTotalDiskStorageSizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoTotalDiskStorageSizeInByte = (string) content.GetValueForProperty("ExtendedInfoTotalDiskStorageSizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal)this).ExtendedInfoTotalDiskStorageSizeInByte, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Additional information on Backup engine specific backup item. + [System.ComponentModel.TypeConverter(typeof(DpmProtectedItemTypeConverter))] + public partial interface IDpmProtectedItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItem.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItem.TypeConverter.cs new file mode 100644 index 000000000000..3f07ea2d0b7a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItem.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DpmProtectedItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DpmProtectedItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DpmProtectedItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DpmProtectedItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItem.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItem.cs new file mode 100644 index 000000000000..ee3ab528d965 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItem.cs @@ -0,0 +1,374 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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.Api20241115.IDpmProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).DiskStorageUsedInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).IsCollocated; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).IsPresentOnCloud; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).LastBackupStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).LastRefreshedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).OnPremiseLatestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).OnPremiseOldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).OnPremiseRecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath ExtendedInfoProtectableObjectLoadPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).ProtectableObjectLoadPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).Protected; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).ProtectionGroupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoInternal)ExtendedInfo).TotalDiskStorageSizeInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 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.Api20241115.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).PolicyId = 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.Api20241115.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal + { + /// Backup Management server protecting this backup item + string BackupEngineName { get; set; } + /// Extended info of the backup item. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItem.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItem.json.cs new file mode 100644 index 000000000000..cbbecb9f8070 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItem.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.ProtectedItem(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..b33e357fc1bc --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfo.PowerShell.cs @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Additional information of DPM Protected item. + [System.ComponentModel.TypeConverter(typeof(DpmProtectedItemExtendedInfoTypeConverter))] + public partial class DpmProtectedItemExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DpmProtectedItemExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DpmProtectedItemExtendedInfo(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DpmProtectedItemExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProtectableObjectLoadPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).ProtectableObjectLoadPath = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath) content.GetValueForProperty("ProtectableObjectLoadPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).ProtectableObjectLoadPath, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmProtectedItemExtendedInfoProtectableObjectLoadPathTypeConverter.ConvertFrom); + } + if (content.Contains("Protected")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).Protected = (bool?) content.GetValueForProperty("Protected",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).Protected, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsPresentOnCloud")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).IsPresentOnCloud = (bool?) content.GetValueForProperty("IsPresentOnCloud",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).IsPresentOnCloud, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).LastBackupStatus = (string) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).LastBackupStatus, global::System.Convert.ToString); + } + if (content.Contains("LastRefreshedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).LastRefreshedAt = (global::System.DateTime?) content.GetValueForProperty("LastRefreshedAt",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).LastRefreshedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).RecoveryPointCount = (int?) content.GetValueForProperty("RecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).RecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OnPremiseOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OnPremiseOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OnPremiseOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OnPremiseOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OnPremiseLatestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OnPremiseLatestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OnPremiseLatestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OnPremiseLatestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OnPremiseRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OnPremiseRecoveryPointCount = (int?) content.GetValueForProperty("OnPremiseRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OnPremiseRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IsCollocated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).IsCollocated = (bool?) content.GetValueForProperty("IsCollocated",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).IsCollocated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtectionGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).ProtectionGroupName = (string) content.GetValueForProperty("ProtectionGroupName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).ProtectionGroupName, global::System.Convert.ToString); + } + if (content.Contains("DiskStorageUsedInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).DiskStorageUsedInByte = (string) content.GetValueForProperty("DiskStorageUsedInByte",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).DiskStorageUsedInByte, global::System.Convert.ToString); + } + if (content.Contains("TotalDiskStorageSizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).TotalDiskStorageSizeInByte = (string) content.GetValueForProperty("TotalDiskStorageSizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).TotalDiskStorageSizeInByte, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DpmProtectedItemExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProtectableObjectLoadPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).ProtectableObjectLoadPath = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath) content.GetValueForProperty("ProtectableObjectLoadPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).ProtectableObjectLoadPath, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DpmProtectedItemExtendedInfoProtectableObjectLoadPathTypeConverter.ConvertFrom); + } + if (content.Contains("Protected")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).Protected = (bool?) content.GetValueForProperty("Protected",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).Protected, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsPresentOnCloud")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).IsPresentOnCloud = (bool?) content.GetValueForProperty("IsPresentOnCloud",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).IsPresentOnCloud, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).LastBackupStatus = (string) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).LastBackupStatus, global::System.Convert.ToString); + } + if (content.Contains("LastRefreshedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).LastRefreshedAt = (global::System.DateTime?) content.GetValueForProperty("LastRefreshedAt",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).LastRefreshedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).RecoveryPointCount = (int?) content.GetValueForProperty("RecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).RecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OnPremiseOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OnPremiseOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OnPremiseOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OnPremiseOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OnPremiseLatestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OnPremiseLatestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OnPremiseLatestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OnPremiseLatestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OnPremiseRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OnPremiseRecoveryPointCount = (int?) content.GetValueForProperty("OnPremiseRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).OnPremiseRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IsCollocated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).IsCollocated = (bool?) content.GetValueForProperty("IsCollocated",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).IsCollocated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtectionGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).ProtectionGroupName = (string) content.GetValueForProperty("ProtectionGroupName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).ProtectionGroupName, global::System.Convert.ToString); + } + if (content.Contains("DiskStorageUsedInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).DiskStorageUsedInByte = (string) content.GetValueForProperty("DiskStorageUsedInByte",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).DiskStorageUsedInByte, global::System.Convert.ToString); + } + if (content.Contains("TotalDiskStorageSizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).TotalDiskStorageSizeInByte = (string) content.GetValueForProperty("TotalDiskStorageSizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoInternal)this).TotalDiskStorageSizeInByte, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Additional information of DPM Protected item. + [System.ComponentModel.TypeConverter(typeof(DpmProtectedItemExtendedInfoTypeConverter))] + public partial interface IDpmProtectedItemExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..3706ea012805 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DpmProtectedItemExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DpmProtectedItemExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DpmProtectedItemExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DpmProtectedItemExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..81a0abce7a9e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IDpmProtectedItemExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath ProtectableObjectLoadPath { get => (this._protectableObjectLoadPath = this._protectableObjectLoadPath ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfo.json.cs new file mode 100644 index 000000000000..31e3a99bb43c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.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.Api20241115.IDpmProtectedItemExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.PowerShell.cs new file mode 100644 index 000000000000..75101fd6f624 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Attribute to provide information on various DBs. + [System.ComponentModel.TypeConverter(typeof(DpmProtectedItemExtendedInfoProtectableObjectLoadPathTypeConverter))] + public partial class DpmProtectedItemExtendedInfoProtectableObjectLoadPath + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DpmProtectedItemExtendedInfoProtectableObjectLoadPath(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DpmProtectedItemExtendedInfoProtectableObjectLoadPath(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DpmProtectedItemExtendedInfoProtectableObjectLoadPath(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DpmProtectedItemExtendedInfoProtectableObjectLoadPath(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Attribute to provide information on various DBs. + [System.ComponentModel.TypeConverter(typeof(DpmProtectedItemExtendedInfoProtectableObjectLoadPathTypeConverter))] + public partial interface IDpmProtectedItemExtendedInfoProtectableObjectLoadPath + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.TypeConverter.cs new file mode 100644 index 000000000000..156b2784fb34 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.TypeConverter.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DpmProtectedItemExtendedInfoProtectableObjectLoadPathTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DpmProtectedItemExtendedInfoProtectableObjectLoadPath.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DpmProtectedItemExtendedInfoProtectableObjectLoadPath.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DpmProtectedItemExtendedInfoProtectableObjectLoadPath.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.cs new file mode 100644 index 000000000000..9ad7576de975 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.dictionary.cs new file mode 100644 index 000000000000..52a71dab7537 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.DpmProtectedItemExtendedInfoProtectableObjectLoadPath source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.json.cs new file mode 100644 index 000000000000..ec9bbe8cdd2b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/DpmProtectedItemExtendedInfoProtectableObjectLoadPath.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDpmProtectedItemExtendedInfoProtectableObjectLoadPath. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/EncryptionDetails.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/EncryptionDetails.PowerShell.cs new file mode 100644 index 000000000000..a8fe317cdf67 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/EncryptionDetails.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Details needed if the VM was encrypted at the time of backup. + [System.ComponentModel.TypeConverter(typeof(EncryptionDetailsTypeConverter))] + public partial class EncryptionDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EncryptionDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EncryptionDetails(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EncryptionDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptionEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).EncryptionEnabled = (bool?) content.GetValueForProperty("EncryptionEnabled",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).EncryptionEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KekUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).KekUrl = (string) content.GetValueForProperty("KekUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).KekUrl, global::System.Convert.ToString); + } + if (content.Contains("SecretKeyUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).SecretKeyUrl = (string) content.GetValueForProperty("SecretKeyUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).SecretKeyUrl, global::System.Convert.ToString); + } + if (content.Contains("KekVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).KekVaultId = (string) content.GetValueForProperty("KekVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).KekVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).SecretKeyVaultId = (string) content.GetValueForProperty("SecretKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).SecretKeyVaultId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EncryptionDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptionEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).EncryptionEnabled = (bool?) content.GetValueForProperty("EncryptionEnabled",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).EncryptionEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KekUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).KekUrl = (string) content.GetValueForProperty("KekUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).KekUrl, global::System.Convert.ToString); + } + if (content.Contains("SecretKeyUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).SecretKeyUrl = (string) content.GetValueForProperty("SecretKeyUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).SecretKeyUrl, global::System.Convert.ToString); + } + if (content.Contains("KekVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).KekVaultId = (string) content.GetValueForProperty("KekVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).KekVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).SecretKeyVaultId = (string) content.GetValueForProperty("SecretKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)this).SecretKeyVaultId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Details needed if the VM was encrypted at the time of backup. + [System.ComponentModel.TypeConverter(typeof(EncryptionDetailsTypeConverter))] + public partial interface IEncryptionDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/EncryptionDetails.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/EncryptionDetails.TypeConverter.cs new file mode 100644 index 000000000000..5115b217fbb8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/EncryptionDetails.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EncryptionDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EncryptionDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EncryptionDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EncryptionDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/EncryptionDetails.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/EncryptionDetails.cs new file mode 100644 index 000000000000..0958ed20d075 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IEncryptionDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/EncryptionDetails.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/EncryptionDetails.json.cs new file mode 100644 index 000000000000..7fc89dc76a52 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/EncryptionDetails.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IEncryptionDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/ErrorDetail.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ErrorDetail.PowerShell.cs new file mode 100644 index 000000000000..62c99f2b62e6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ErrorDetail.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Error Detail class which encapsulates Code, Message and Recommendations. + [System.ComponentModel.TypeConverter(typeof(ErrorDetailTypeConverter))] + public partial class ErrorDetail + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorDetail(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorDetail(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorDetail(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorDetail(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Error Detail class which encapsulates Code, Message and Recommendations. + [System.ComponentModel.TypeConverter(typeof(ErrorDetailTypeConverter))] + public partial interface IErrorDetail + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ErrorDetail.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ErrorDetail.TypeConverter.cs new file mode 100644 index 000000000000..98b555c1296e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ErrorDetail.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorDetailTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetail ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetail).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorDetail.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorDetail.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorDetail.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ErrorDetail.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ErrorDetail.cs new file mode 100644 index 000000000000..a29759860aa4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IErrorDetail, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for Recommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/ErrorDetail.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ErrorDetail.json.cs new file mode 100644 index 000000000000..925d20f3d5b6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ErrorDetail.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IErrorDetail. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IErrorDetail. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/ExtendedProperties.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ExtendedProperties.PowerShell.cs new file mode 100644 index 000000000000..4d2ea21b7dd8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ExtendedProperties.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Extended Properties for Azure IaasVM Backup. + [System.ComponentModel.TypeConverter(typeof(ExtendedPropertiesTypeConverter))] + public partial class ExtendedProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExtendedProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExtendedProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExtendedProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DiskExclusionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal)this).DiskExclusionProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties) content.GetValueForProperty("DiskExclusionProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal)this).DiskExclusionProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskExclusionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DiskExclusionPropertyDiskLunList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal)this).DiskExclusionPropertyDiskLunList = (int[]) content.GetValueForProperty("DiskExclusionPropertyDiskLunList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal)this).DiskExclusionPropertyDiskLunList, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("DiskExclusionPropertyIsInclusionList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal)this).DiskExclusionPropertyIsInclusionList = (bool?) content.GetValueForProperty("DiskExclusionPropertyIsInclusionList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal)this).DiskExclusionPropertyIsInclusionList, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExtendedProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DiskExclusionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal)this).DiskExclusionProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties) content.GetValueForProperty("DiskExclusionProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal)this).DiskExclusionProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskExclusionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DiskExclusionPropertyDiskLunList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal)this).DiskExclusionPropertyDiskLunList = (int[]) content.GetValueForProperty("DiskExclusionPropertyDiskLunList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal)this).DiskExclusionPropertyDiskLunList, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("DiskExclusionPropertyIsInclusionList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal)this).DiskExclusionPropertyIsInclusionList = (bool?) content.GetValueForProperty("DiskExclusionPropertyIsInclusionList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal)this).DiskExclusionPropertyIsInclusionList, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Extended Properties for Azure IaasVM Backup. + [System.ComponentModel.TypeConverter(typeof(ExtendedPropertiesTypeConverter))] + public partial interface IExtendedProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ExtendedProperties.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ExtendedProperties.TypeConverter.cs new file mode 100644 index 000000000000..2b06c8b13584 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ExtendedProperties.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExtendedPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExtendedProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExtendedProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExtendedProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ExtendedProperties.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ExtendedProperties.cs new file mode 100644 index 000000000000..ebc329f66bd1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ExtendedProperties.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.Api20241115 +{ + 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.Api20241115.IExtendedProperties, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDiskExclusionProperties DiskExclusionProperty { get => (this._diskExclusionProperty = this._diskExclusionProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDiskExclusionPropertiesInternal)DiskExclusionProperty).DiskLunList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDiskExclusionPropertiesInternal)DiskExclusionProperty).IsInclusionList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionPropertiesInternal)DiskExclusionProperty).IsInclusionList = value ?? default(bool); } + + /// Internal Acessors for DiskExclusionProperty + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskExclusionProperties Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedPropertiesInternal.DiskExclusionProperty { get => (this._diskExclusionProperty = this._diskExclusionProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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; } + + } + /// Extended Properties for Azure IaasVM Backup. + internal partial interface IExtendedPropertiesInternal + + { + /// Extended Properties for Disk Exclusion. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ExtendedProperties.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ExtendedProperties.json.cs new file mode 100644 index 000000000000..d0767db03fbe --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.DiskExclusionProperties.FromJson(__jsonDiskExclusionProperties) : DiskExclusionProperty;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IExtendedProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItem.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItem.PowerShell.cs new file mode 100644 index 000000000000..12b377c6d6a4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItem.PowerShell.cs @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Base class for backup items. + [System.ComponentModel.TypeConverter(typeof(GenericProtectedItemTypeConverter))] + public partial class GenericProtectedItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GenericProtectedItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GenericProtectedItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GenericProtectedItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("PolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).PolicyState = (string) content.GetValueForProperty("PolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).PolicyState, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("ProtectedItemId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).ProtectedItemId = (long?) content.GetValueForProperty("ProtectedItemId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).ProtectedItemId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SourceAssociation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).SourceAssociation = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemSourceAssociations) content.GetValueForProperty("SourceAssociation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).SourceAssociation, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.GenericProtectedItemSourceAssociationsTypeConverter.ConvertFrom); + } + if (content.Contains("FabricName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).FabricName = (string) content.GetValueForProperty("FabricName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).FabricName, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GenericProtectedItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("PolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).PolicyState = (string) content.GetValueForProperty("PolicyState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).PolicyState, global::System.Convert.ToString); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).ProtectionState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState?) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).ProtectionState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionState.CreateFrom); + } + if (content.Contains("ProtectedItemId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).ProtectedItemId = (long?) content.GetValueForProperty("ProtectedItemId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).ProtectedItemId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SourceAssociation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).SourceAssociation = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemSourceAssociations) content.GetValueForProperty("SourceAssociation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).SourceAssociation, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.GenericProtectedItemSourceAssociationsTypeConverter.ConvertFrom); + } + if (content.Contains("FabricName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).FabricName = (string) content.GetValueForProperty("FabricName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal)this).FabricName, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base class for backup items. + [System.ComponentModel.TypeConverter(typeof(GenericProtectedItemTypeConverter))] + public partial interface IGenericProtectedItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItem.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItem.TypeConverter.cs new file mode 100644 index 000000000000..961f6163c142 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItem.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GenericProtectedItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GenericProtectedItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GenericProtectedItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GenericProtectedItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItem.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItem.cs new file mode 100644 index 000000000000..02e0dc370c93 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItem.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for backup items. + public partial class GenericProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 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.Api20241115.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).PolicyId = 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.Api20241115.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IGenericProtectedItemSourceAssociations SourceAssociation { get => (this._sourceAssociation = this._sourceAssociation ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IGenericProtectedItemSourceAssociations) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemSourceAssociations SourceAssociation { get; set; } + + } + /// Base class for backup items. + internal partial interface IGenericProtectedItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IGenericProtectedItemSourceAssociations SourceAssociation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItem.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItem.json.cs new file mode 100644 index 000000000000..fbc0737d384f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItem.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IGenericProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItemSourceAssociations.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItemSourceAssociations.PowerShell.cs new file mode 100644 index 000000000000..9fa3e8058407 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItemSourceAssociations.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// Loosely coupled (type, value) associations (example - parent of a protected item) + /// + [System.ComponentModel.TypeConverter(typeof(GenericProtectedItemSourceAssociationsTypeConverter))] + public partial class GenericProtectedItemSourceAssociations + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemSourceAssociations DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GenericProtectedItemSourceAssociations(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemSourceAssociations DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GenericProtectedItemSourceAssociations(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemSourceAssociations FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GenericProtectedItemSourceAssociations(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GenericProtectedItemSourceAssociations(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Loosely coupled (type, value) associations (example - parent of a protected item) + [System.ComponentModel.TypeConverter(typeof(GenericProtectedItemSourceAssociationsTypeConverter))] + public partial interface IGenericProtectedItemSourceAssociations + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItemSourceAssociations.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItemSourceAssociations.TypeConverter.cs new file mode 100644 index 000000000000..5e0bf6a95e50 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItemSourceAssociations.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GenericProtectedItemSourceAssociationsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemSourceAssociations ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemSourceAssociations).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GenericProtectedItemSourceAssociations.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GenericProtectedItemSourceAssociations.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GenericProtectedItemSourceAssociations.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItemSourceAssociations.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItemSourceAssociations.cs new file mode 100644 index 000000000000..16179233ef5e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IGenericProtectedItemSourceAssociations, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItemSourceAssociations.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItemSourceAssociations.dictionary.cs new file mode 100644 index 000000000000..e4788fd46e30 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.GenericProtectedItemSourceAssociations source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItemSourceAssociations.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItemSourceAssociations.json.cs new file mode 100644 index 000000000000..82a8ecbf2384 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericProtectedItemSourceAssociations.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IGenericProtectedItemSourceAssociations. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericProtectedItemSourceAssociations. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/GenericRecoveryPoint.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericRecoveryPoint.PowerShell.cs new file mode 100644 index 000000000000..9223f45062bd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericRecoveryPoint.PowerShell.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Generic backup copy. + [System.ComponentModel.TypeConverter(typeof(GenericRecoveryPointTypeConverter))] + public partial class GenericRecoveryPoint + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GenericRecoveryPoint(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GenericRecoveryPoint(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GenericRecoveryPoint(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointType = (string) content.GetValueForProperty("RecoveryPointType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointTime = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointAdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointAdditionalInfo = (string) content.GetValueForProperty("RecoveryPointAdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointAdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GenericRecoveryPoint(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointType = (string) content.GetValueForProperty("RecoveryPointType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointTime = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointAdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointAdditionalInfo = (string) content.GetValueForProperty("RecoveryPointAdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointAdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Generic backup copy. + [System.ComponentModel.TypeConverter(typeof(GenericRecoveryPointTypeConverter))] + public partial interface IGenericRecoveryPoint + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericRecoveryPoint.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericRecoveryPoint.TypeConverter.cs new file mode 100644 index 000000000000..01284b5782d5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericRecoveryPoint.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GenericRecoveryPointTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPoint ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPoint).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GenericRecoveryPoint.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GenericRecoveryPoint.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GenericRecoveryPoint.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericRecoveryPoint.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericRecoveryPoint.cs new file mode 100644 index 000000000000..8bb85f934a4c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericRecoveryPoint.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Generic backup copy. + public partial class GenericRecoveryPoint : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint __recoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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; } + + /// Internal Acessors for RecoveryPointProperty + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPointInternal.RecoveryPointProperty { get => (this._recoveryPointProperty = this._recoveryPointProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointProperties()); set { {_recoveryPointProperty = 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.Api20241115.IRecoveryPointInternal)__recoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties _recoveryPointProperty; + + /// Properties of Recovery Point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties RecoveryPointProperty { get => (this._recoveryPointProperty = this._recoveryPointProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointProperties()); set => this._recoveryPointProperty = value; } + + /// Expiry time of Recovery Point in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RecoveryPointPropertyExpiryTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).ExpiryTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).ExpiryTime = value ?? null; } + + /// Bool to indicate whether RP is in soft delete state or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? RecoveryPointPropertyIsSoftDeleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).IsSoftDeleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).IsSoftDeleted = value ?? default(bool); } + + /// Rule name tagged on Recovery Point that governs life cycle + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RecoveryPointPropertyRuleName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).RuleName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).RuleName = value ?? null; } + + /// 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.Api20241115.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; } + /// Expiry time of Recovery Point in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiry time of Recovery Point in UTC.", + SerializedName = @"expiryTime", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointPropertyExpiryTime { get; set; } + /// Bool to indicate whether RP is in soft delete state or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Bool to indicate whether RP is in soft delete state or not", + SerializedName = @"isSoftDeleted", + PossibleTypes = new [] { typeof(bool) })] + bool? RecoveryPointPropertyIsSoftDeleted { get; set; } + /// Rule name tagged on Recovery Point that governs life cycle + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rule name tagged on Recovery Point that governs life cycle", + SerializedName = @"ruleName", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointPropertyRuleName { 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.Api20241115.IRecoveryPointInternal + { + /// Friendly name of the backup copy. + string FriendlyName { get; set; } + /// Additional information associated with this backup copy. + string RecoveryPointAdditionalInfo { get; set; } + /// Properties of Recovery Point + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties RecoveryPointProperty { get; set; } + /// Expiry time of Recovery Point in UTC. + string RecoveryPointPropertyExpiryTime { get; set; } + /// Bool to indicate whether RP is in soft delete state or not + bool? RecoveryPointPropertyIsSoftDeleted { get; set; } + /// Rule name tagged on Recovery Point that governs life cycle + string RecoveryPointPropertyRuleName { 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.DefaultTag/generated/api/Models/Api20241115/GenericRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericRecoveryPoint.json.cs new file mode 100644 index 000000000000..c4f25f4108a1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/GenericRecoveryPoint.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IGenericRecoveryPoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IGenericRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.RecoveryPoint(json); + {_recoveryPointProperty = If( json?.PropertyT("recoveryPointProperties"), out var __jsonRecoveryPointProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointProperties.FromJson(__jsonRecoveryPointProperties) : RecoveryPointProperty;} + {_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 != this._recoveryPointProperty ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._recoveryPointProperty.ToJson(null,serializationMode) : null, "recoveryPointProperties" ,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._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.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPoint.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPoint.PowerShell.cs new file mode 100644 index 000000000000..5c5883834f00 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPoint.PowerShell.cs @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// IaaS VM workload specific backup copy. + [System.ComponentModel.TypeConverter(typeof(IaasVMRecoveryPointTypeConverter))] + public partial class IaasVMRecoveryPoint + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IaasVMRecoveryPoint(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IaasVMRecoveryPoint(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IaasVMRecoveryPoint(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyAndSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecret = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetails) content.GetValueForProperty("KeyAndSecret",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecret, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.KeyAndSecretDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointDiskConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfiguration) content.GetValueForProperty("RecoveryPointDiskConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfiguration, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointDiskConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointType = (string) content.GetValueForProperty("RecoveryPointType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointTime = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointAdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointAdditionalInfo = (string) content.GetValueForProperty("RecoveryPointAdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointAdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("SourceVMStorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).SourceVMStorageType = (string) content.GetValueForProperty("SourceVMStorageType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).SourceVMStorageType, global::System.Convert.ToString); + } + if (content.Contains("IsSourceVMEncrypted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).IsSourceVMEncrypted = (bool?) content.GetValueForProperty("IsSourceVMEncrypted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).IsSourceVMEncrypted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsInstantIlrSessionActive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).IsInstantIlrSessionActive = (bool?) content.GetValueForProperty("IsInstantIlrSessionActive",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).IsInstantIlrSessionActive, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RecoveryPointTierDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointTierDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[]) content.GetValueForProperty("RecoveryPointTierDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointTierDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("IsManagedVirtualMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).IsManagedVirtualMachine = (bool?) content.GetValueForProperty("IsManagedVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).IsManagedVirtualMachine, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("VirtualMachineSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).VirtualMachineSize = (string) content.GetValueForProperty("VirtualMachineSize",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).VirtualMachineSize, global::System.Convert.ToString); + } + if (content.Contains("OriginalStorageAccountOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).OriginalStorageAccountOption = (bool?) content.GetValueForProperty("OriginalStorageAccountOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).OriginalStorageAccountOption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).OSType, global::System.Convert.ToString); + } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("RecoveryPointMoveReadinessInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointMoveReadinessInfo) content.GetValueForProperty("RecoveryPointMoveReadinessInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IaasVMRecoveryPointMoveReadinessInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("KeyAndSecretKekDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecretKekDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetails) content.GetValueForProperty("KeyAndSecretKekDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecretKekDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.KekDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("KeyAndSecretBekDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecretBekDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetails) content.GetValueForProperty("KeyAndSecretBekDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecretBekDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BekDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("KeyAndSecretEncryptionMechanism")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecretEncryptionMechanism = (string) content.GetValueForProperty("KeyAndSecretEncryptionMechanism",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecretEncryptionMechanism, global::System.Convert.ToString); + } + if (content.Contains("KekDetailKeyUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KekDetailKeyUrl = (string) content.GetValueForProperty("KekDetailKeyUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KekDetailKeyUrl, global::System.Convert.ToString); + } + if (content.Contains("BekDetailSecretUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).BekDetailSecretUrl = (string) content.GetValueForProperty("BekDetailSecretUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).BekDetailSecretUrl, global::System.Convert.ToString); + } + if (content.Contains("BekDetailSecretData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).BekDetailSecretData = (string) content.GetValueForProperty("BekDetailSecretData",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).BekDetailSecretData, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointDiskConfigurationNumberOfDisksIncludedInBackup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationNumberOfDisksIncludedInBackup = (int?) content.GetValueForProperty("RecoveryPointDiskConfigurationNumberOfDisksIncludedInBackup",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationNumberOfDisksIncludedInBackup, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RecoveryPointDiskConfigurationNumberOfDisksAttachedToVM")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationNumberOfDisksAttachedToVM = (int?) content.GetValueForProperty("RecoveryPointDiskConfigurationNumberOfDisksAttachedToVM",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationNumberOfDisksAttachedToVM, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RecoveryPointDiskConfigurationIncludedDiskList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationIncludedDiskList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation[]) content.GetValueForProperty("RecoveryPointDiskConfigurationIncludedDiskList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationIncludedDiskList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointDiskConfigurationExcludedDiskList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationExcludedDiskList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation[]) content.GetValueForProperty("RecoveryPointDiskConfigurationExcludedDiskList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationExcludedDiskList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KekDetailKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KekDetailKeyVaultId = (string) content.GetValueForProperty("KekDetailKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KekDetailKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("KekDetailKeyBackupData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KekDetailKeyBackupData = (string) content.GetValueForProperty("KekDetailKeyBackupData",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KekDetailKeyBackupData, global::System.Convert.ToString); + } + if (content.Contains("BekDetailSecretVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).BekDetailSecretVaultId = (string) content.GetValueForProperty("BekDetailSecretVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).BekDetailSecretVaultId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IaasVMRecoveryPoint(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyAndSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecret = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetails) content.GetValueForProperty("KeyAndSecret",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecret, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.KeyAndSecretDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointDiskConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfiguration) content.GetValueForProperty("RecoveryPointDiskConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfiguration, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointDiskConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointProperty = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties) content.GetValueForProperty("RecoveryPointProperty",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointProperty, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointType = (string) content.GetValueForProperty("RecoveryPointType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointTime = (global::System.DateTime?) content.GetValueForProperty("RecoveryPointTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointAdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointAdditionalInfo = (string) content.GetValueForProperty("RecoveryPointAdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointAdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("SourceVMStorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).SourceVMStorageType = (string) content.GetValueForProperty("SourceVMStorageType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).SourceVMStorageType, global::System.Convert.ToString); + } + if (content.Contains("IsSourceVMEncrypted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).IsSourceVMEncrypted = (bool?) content.GetValueForProperty("IsSourceVMEncrypted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).IsSourceVMEncrypted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsInstantIlrSessionActive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).IsInstantIlrSessionActive = (bool?) content.GetValueForProperty("IsInstantIlrSessionActive",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).IsInstantIlrSessionActive, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RecoveryPointTierDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointTierDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[]) content.GetValueForProperty("RecoveryPointTierDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointTierDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("IsManagedVirtualMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).IsManagedVirtualMachine = (bool?) content.GetValueForProperty("IsManagedVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).IsManagedVirtualMachine, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("VirtualMachineSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).VirtualMachineSize = (string) content.GetValueForProperty("VirtualMachineSize",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).VirtualMachineSize, global::System.Convert.ToString); + } + if (content.Contains("OriginalStorageAccountOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).OriginalStorageAccountOption = (bool?) content.GetValueForProperty("OriginalStorageAccountOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).OriginalStorageAccountOption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).OSType, global::System.Convert.ToString); + } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("RecoveryPointMoveReadinessInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointMoveReadinessInfo) content.GetValueForProperty("RecoveryPointMoveReadinessInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointMoveReadinessInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IaasVMRecoveryPointMoveReadinessInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("KeyAndSecretKekDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecretKekDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetails) content.GetValueForProperty("KeyAndSecretKekDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecretKekDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.KekDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("KeyAndSecretBekDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecretBekDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetails) content.GetValueForProperty("KeyAndSecretBekDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecretBekDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BekDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointPropertyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime = (string) content.GetValueForProperty("RecoveryPointPropertyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointPropertyExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointPropertyRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointPropertyRuleName = (string) content.GetValueForProperty("RecoveryPointPropertyRuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointPropertyRuleName, global::System.Convert.ToString); + } + if (content.Contains("KeyAndSecretEncryptionMechanism")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecretEncryptionMechanism = (string) content.GetValueForProperty("KeyAndSecretEncryptionMechanism",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KeyAndSecretEncryptionMechanism, global::System.Convert.ToString); + } + if (content.Contains("KekDetailKeyUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KekDetailKeyUrl = (string) content.GetValueForProperty("KekDetailKeyUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KekDetailKeyUrl, global::System.Convert.ToString); + } + if (content.Contains("BekDetailSecretUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).BekDetailSecretUrl = (string) content.GetValueForProperty("BekDetailSecretUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).BekDetailSecretUrl, global::System.Convert.ToString); + } + if (content.Contains("BekDetailSecretData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).BekDetailSecretData = (string) content.GetValueForProperty("BekDetailSecretData",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).BekDetailSecretData, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointDiskConfigurationNumberOfDisksIncludedInBackup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationNumberOfDisksIncludedInBackup = (int?) content.GetValueForProperty("RecoveryPointDiskConfigurationNumberOfDisksIncludedInBackup",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationNumberOfDisksIncludedInBackup, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RecoveryPointDiskConfigurationNumberOfDisksAttachedToVM")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationNumberOfDisksAttachedToVM = (int?) content.GetValueForProperty("RecoveryPointDiskConfigurationNumberOfDisksAttachedToVM",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationNumberOfDisksAttachedToVM, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RecoveryPointDiskConfigurationIncludedDiskList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationIncludedDiskList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation[]) content.GetValueForProperty("RecoveryPointDiskConfigurationIncludedDiskList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationIncludedDiskList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointDiskConfigurationExcludedDiskList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationExcludedDiskList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation[]) content.GetValueForProperty("RecoveryPointDiskConfigurationExcludedDiskList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointDiskConfigurationExcludedDiskList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("RecoveryPointPropertyIsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted = (bool?) content.GetValueForProperty("RecoveryPointPropertyIsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).RecoveryPointPropertyIsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KekDetailKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KekDetailKeyVaultId = (string) content.GetValueForProperty("KekDetailKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KekDetailKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("KekDetailKeyBackupData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KekDetailKeyBackupData = (string) content.GetValueForProperty("KekDetailKeyBackupData",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).KekDetailKeyBackupData, global::System.Convert.ToString); + } + if (content.Contains("BekDetailSecretVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).BekDetailSecretVaultId = (string) content.GetValueForProperty("BekDetailSecretVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal)this).BekDetailSecretVaultId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// IaaS VM workload specific backup copy. + [System.ComponentModel.TypeConverter(typeof(IaasVMRecoveryPointTypeConverter))] + public partial interface IIaasVMRecoveryPoint + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPoint.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPoint.TypeConverter.cs new file mode 100644 index 000000000000..497c14a17b2f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPoint.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IaasVMRecoveryPointTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPoint ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPoint).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IaasVMRecoveryPoint.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IaasVMRecoveryPoint.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IaasVMRecoveryPoint.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPoint.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPoint.cs new file mode 100644 index 000000000000..a0d3748dabe1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPoint.cs @@ -0,0 +1,547 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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.Api20241115.IIaasVMRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint __recoveryPoint = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IKeyAndSecretDetailsInternal)KeyAndSecret).BekDetailSecretData; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IKeyAndSecretDetailsInternal)KeyAndSecret).BekDetailSecretUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IKeyAndSecretDetailsInternal)KeyAndSecret).BekDetailSecretVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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; } + + /// 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.Api20241115.IKeyAndSecretDetailsInternal)KeyAndSecret).KekDetailKeyBackupData; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IKeyAndSecretDetailsInternal)KeyAndSecret).KekDetailKeyUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IKeyAndSecretDetailsInternal)KeyAndSecret).KekDetailKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)KeyAndSecret).KekDetailKeyVaultId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IKeyAndSecretDetails KeyAndSecret { get => (this._keyAndSecret = this._keyAndSecret ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IKeyAndSecretDetailsInternal)KeyAndSecret).EncryptionMechanism; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)KeyAndSecret).EncryptionMechanism = value ?? null; } + + /// Internal Acessors for IsSourceVMEncrypted + bool? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal.IsSourceVMEncrypted { get => this._isSourceVMEncrypted; set { {_isSourceVMEncrypted = value;} } } + + /// Internal Acessors for KeyAndSecret + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetails Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal.KeyAndSecret { get => (this._keyAndSecret = this._keyAndSecret ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.KeyAndSecretDetails()); set { {_keyAndSecret = value;} } } + + /// Internal Acessors for KeyAndSecretBekDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetails Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal.KeyAndSecretBekDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)KeyAndSecret).BekDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)KeyAndSecret).BekDetail = value; } + + /// Internal Acessors for KeyAndSecretKekDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetails Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal.KeyAndSecretKekDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)KeyAndSecret).KekDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)KeyAndSecret).KekDetail = value; } + + /// Internal Acessors for RecoveryPointAdditionalInfo + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal.RecoveryPointAdditionalInfo { get => this._recoveryPointAdditionalInfo; set { {_recoveryPointAdditionalInfo = value;} } } + + /// Internal Acessors for RecoveryPointDiskConfiguration + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfiguration Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal.RecoveryPointDiskConfiguration { get => (this._recoveryPointDiskConfiguration = this._recoveryPointDiskConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointDiskConfiguration()); set { {_recoveryPointDiskConfiguration = value;} } } + + /// Internal Acessors for RecoveryPointProperty + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal.RecoveryPointProperty { get => (this._recoveryPointProperty = this._recoveryPointProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointProperties()); set { {_recoveryPointProperty = value;} } } + + /// Internal Acessors for RecoveryPointTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal.RecoveryPointTime { get => this._recoveryPointTime; set { {_recoveryPointTime = value;} } } + + /// Internal Acessors for RecoveryPointType + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal.RecoveryPointType { get => this._recoveryPointType; set { {_recoveryPointType = value;} } } + + /// Internal Acessors for SourceVMStorageType + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointInternal.SourceVMStorageType { get => this._sourceVMStorageType; set { {_sourceVMStorageType = 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.Api20241115.IRecoveryPointInternal)__recoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfiguration _recoveryPointDiskConfiguration; + + /// Disk configuration + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfiguration RecoveryPointDiskConfiguration { get => (this._recoveryPointDiskConfiguration = this._recoveryPointDiskConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDiskInformation[] RecoveryPointDiskConfigurationExcludedDiskList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)RecoveryPointDiskConfiguration).ExcludedDiskList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDiskInformation[] RecoveryPointDiskConfigurationIncludedDiskList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)RecoveryPointDiskConfiguration).IncludedDiskList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRecoveryPointDiskConfigurationInternal)RecoveryPointDiskConfiguration).NumberOfDisksAttachedToVM; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRecoveryPointDiskConfigurationInternal)RecoveryPointDiskConfiguration).NumberOfDisksIncludedInBackup; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)RecoveryPointDiskConfiguration).NumberOfDisksIncludedInBackup = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IIaasVMRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get => (this._recoveryPointMoveReadinessInfo = this._recoveryPointMoveReadinessInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IaasVMRecoveryPointMoveReadinessInfo()); set => this._recoveryPointMoveReadinessInfo = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties _recoveryPointProperty; + + /// Properties of Recovery Point + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties RecoveryPointProperty { get => (this._recoveryPointProperty = this._recoveryPointProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointProperties()); set => this._recoveryPointProperty = value; } + + /// Expiry time of Recovery Point in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RecoveryPointPropertyExpiryTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).ExpiryTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).ExpiryTime = value ?? null; } + + /// Bool to indicate whether RP is in soft delete state or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public bool? RecoveryPointPropertyIsSoftDeleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).IsSoftDeleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).IsSoftDeleted = value ?? default(bool); } + + /// Rule name tagged on Recovery Point that governs life cycle + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inlined)] + public string RecoveryPointPropertyRuleName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).RuleName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)RecoveryPointProperty).RuleName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[] _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.Api20241115.IRecoveryPointTierInformation[] 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; } + + /// 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; } + + /// 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; } + + /// 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.Api20241115.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 = true, + Description = @"Identifies whether the VM was encrypted when the backup copy is created.", + SerializedName = @"isSourceVMEncrypted", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSourceVMEncrypted { get; } + /// 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 = true, + Description = @"Additional information associated with this backup copy.", + SerializedName = @"recoveryPointAdditionalInfo", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointAdditionalInfo { get; } + /// 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.Api20241115.IDiskInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDiskInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IIaasVMRecoveryPointMoveReadinessInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get; set; } + /// Expiry time of Recovery Point in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiry time of Recovery Point in UTC.", + SerializedName = @"expiryTime", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointPropertyExpiryTime { get; set; } + /// Bool to indicate whether RP is in soft delete state or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Bool to indicate whether RP is in soft delete state or not", + SerializedName = @"isSoftDeleted", + PossibleTypes = new [] { typeof(bool) })] + bool? RecoveryPointPropertyIsSoftDeleted { get; set; } + /// Rule name tagged on Recovery Point that governs life cycle + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rule name tagged on Recovery Point that governs life cycle", + SerializedName = @"ruleName", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointPropertyRuleName { 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.Api20241115.IRecoveryPointTierInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[] RecoveryPointTierDetail { get; set; } + /// Time at which this backup copy was created. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Time at which this backup copy was created.", + SerializedName = @"recoveryPointTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RecoveryPointTime { get; } + /// Type of the backup copy. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the backup copy.", + SerializedName = @"recoveryPointType", + PossibleTypes = new [] { typeof(string) })] + string RecoveryPointType { get; } + /// Storage type of the VM whose backup copy is created. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Storage type of the VM whose backup copy is created.", + SerializedName = @"sourceVMStorageType", + PossibleTypes = new [] { typeof(string) })] + string SourceVMStorageType { get; } + /// 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.Api20241115.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.Api20241115.IKeyAndSecretDetails KeyAndSecret { get; set; } + /// BEK is bitlocker encryption key. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IRecoveryPointDiskConfiguration RecoveryPointDiskConfiguration { get; set; } + /// Information of disks excluded from backup + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation[] RecoveryPointDiskConfigurationExcludedDiskList { get; set; } + /// Information of disks included in backup + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IIaasVMRecoveryPointMoveReadinessInfo RecoveryPointMoveReadinessInfo { get; set; } + /// Properties of Recovery Point + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties RecoveryPointProperty { get; set; } + /// Expiry time of Recovery Point in UTC. + string RecoveryPointPropertyExpiryTime { get; set; } + /// Bool to indicate whether RP is in soft delete state or not + bool? RecoveryPointPropertyIsSoftDeleted { get; set; } + /// Rule name tagged on Recovery Point that governs life cycle + string RecoveryPointPropertyRuleName { get; set; } + /// Recovery point tier information. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation[] 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.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPoint.json.cs new file mode 100644 index 000000000000..49f589f1b14a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPoint.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IIaasVMRecoveryPoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.RecoveryPoint(json); + {_keyAndSecret = If( json?.PropertyT("keyAndSecret"), out var __jsonKeyAndSecret) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.KeyAndSecretDetails.FromJson(__jsonKeyAndSecret) : KeyAndSecret;} + {_recoveryPointDiskConfiguration = If( json?.PropertyT("recoveryPointDiskConfiguration"), out var __jsonRecoveryPointDiskConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointDiskConfiguration.FromJson(__jsonRecoveryPointDiskConfiguration) : RecoveryPointDiskConfiguration;} + {_recoveryPointProperty = If( json?.PropertyT("recoveryPointProperties"), out var __jsonRecoveryPointProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointProperties.FromJson(__jsonRecoveryPointProperties) : RecoveryPointProperty;} + {_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.Api20241115.IRecoveryPointTierInformation) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformation.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.Api20241115.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 != this._recoveryPointProperty ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._recoveryPointProperty.ToJson(null,serializationMode) : null, "recoveryPointProperties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + 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 ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + 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 ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + 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 ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + 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 ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeReadOnly)) + { + 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.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPointMoveReadinessInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPointMoveReadinessInfo.PowerShell.cs new file mode 100644 index 000000000000..a5c04d1da121 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPointMoveReadinessInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Eligibility of RP to be moved to another tier + [System.ComponentModel.TypeConverter(typeof(IaasVMRecoveryPointMoveReadinessInfoTypeConverter))] + public partial class IaasVMRecoveryPointMoveReadinessInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointMoveReadinessInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IaasVMRecoveryPointMoveReadinessInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointMoveReadinessInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IaasVMRecoveryPointMoveReadinessInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointMoveReadinessInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IaasVMRecoveryPointMoveReadinessInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IaasVMRecoveryPointMoveReadinessInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Eligibility of RP to be moved to another tier + [System.ComponentModel.TypeConverter(typeof(IaasVMRecoveryPointMoveReadinessInfoTypeConverter))] + public partial interface IIaasVMRecoveryPointMoveReadinessInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPointMoveReadinessInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPointMoveReadinessInfo.TypeConverter.cs new file mode 100644 index 000000000000..9c8c731da7fd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPointMoveReadinessInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IaasVMRecoveryPointMoveReadinessInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointMoveReadinessInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointMoveReadinessInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IaasVMRecoveryPointMoveReadinessInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IaasVMRecoveryPointMoveReadinessInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IaasVMRecoveryPointMoveReadinessInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPointMoveReadinessInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPointMoveReadinessInfo.cs new file mode 100644 index 000000000000..5856ae4f4deb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IIaasVMRecoveryPointMoveReadinessInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPointMoveReadinessInfo.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPointMoveReadinessInfo.dictionary.cs new file mode 100644 index 000000000000..97b5f1971e29 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.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.Api20241115.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.Api20241115.IRecoveryPointMoveReadinessInfo value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IaasVMRecoveryPointMoveReadinessInfo source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPointMoveReadinessInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPointMoveReadinessInfo.json.cs new file mode 100644 index 000000000000..623a9f4ac691 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRecoveryPointMoveReadinessInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IIaasVMRecoveryPointMoveReadinessInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRecoveryPointMoveReadinessInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/IaasVMRestoreRequest.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRestoreRequest.PowerShell.cs new file mode 100644 index 000000000000..ccdd62e0daea --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRestoreRequest.PowerShell.cs @@ -0,0 +1,378 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// IaaS VM workload-specific restore. + [System.ComponentModel.TypeConverter(typeof(IaasVMRestoreRequestTypeConverter))] + public partial class IaasVMRestoreRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IaasVMRestoreRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IaasVMRestoreRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IaasVMRestoreRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptionDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetails) content.GetValueForProperty("EncryptionDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.EncryptionDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfo) content.GetValueForProperty("IdentityInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityBasedRestoreDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityBasedRestoreDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetails) content.GetValueForProperty("IdentityBasedRestoreDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityBasedRestoreDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IdentityBasedRestoreDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RecoveryPointId = (string) content.GetValueForProperty("RecoveryPointId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RecoveryPointId, global::System.Convert.ToString); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetVirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).TargetVirtualMachineId = (string) content.GetValueForProperty("TargetVirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).TargetVirtualMachineId, global::System.Convert.ToString); + } + if (content.Contains("TargetResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).TargetResourceGroupId = (string) content.GetValueForProperty("TargetResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).TargetResourceGroupId, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("VirtualNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).VirtualNetworkId = (string) content.GetValueForProperty("VirtualNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).VirtualNetworkId, global::System.Convert.ToString); + } + if (content.Contains("SubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).SubnetId = (string) content.GetValueForProperty("SubnetId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).SubnetId, global::System.Convert.ToString); + } + if (content.Contains("TargetDomainNameId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).TargetDomainNameId = (string) content.GetValueForProperty("TargetDomainNameId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).TargetDomainNameId, global::System.Convert.ToString); + } + if (content.Contains("Region")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).Region = (string) content.GetValueForProperty("Region",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).Region, global::System.Convert.ToString); + } + if (content.Contains("AffinityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).AffinityGroup = (string) content.GetValueForProperty("AffinityGroup",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).AffinityGroup, global::System.Convert.ToString); + } + if (content.Contains("CreateNewCloudService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).CreateNewCloudService = (bool?) content.GetValueForProperty("CreateNewCloudService",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).CreateNewCloudService, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OriginalStorageAccountOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).OriginalStorageAccountOption = (bool?) content.GetValueForProperty("OriginalStorageAccountOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).OriginalStorageAccountOption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RestoreDiskLunList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RestoreDiskLunList = (int[]) content.GetValueForProperty("RestoreDiskLunList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RestoreDiskLunList, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("RestoreWithManagedDisk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RestoreWithManagedDisk = (bool?) content.GetValueForProperty("RestoreWithManagedDisk",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RestoreWithManagedDisk, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskEncryptionSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).DiskEncryptionSetId = (string) content.GetValueForProperty("DiskEncryptionSetId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).DiskEncryptionSetId, global::System.Convert.ToString); + } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("EncryptionDetailKekUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailKekUrl = (string) content.GetValueForProperty("EncryptionDetailKekUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailKekUrl, global::System.Convert.ToString); + } + if (content.Contains("IdentityBasedRestoreDetailObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityBasedRestoreDetailObjectType = (string) content.GetValueForProperty("IdentityBasedRestoreDetailObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityBasedRestoreDetailObjectType, global::System.Convert.ToString); + } + if (content.Contains("EncryptionDetailEncryptionEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailEncryptionEnabled = (bool?) content.GetValueForProperty("EncryptionDetailEncryptionEnabled",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailEncryptionEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EncryptionDetailSecretKeyUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailSecretKeyUrl = (string) content.GetValueForProperty("EncryptionDetailSecretKeyUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailSecretKeyUrl, global::System.Convert.ToString); + } + if (content.Contains("EncryptionDetailKekVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailKekVaultId = (string) content.GetValueForProperty("EncryptionDetailKekVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailKekVaultId, global::System.Convert.ToString); + } + if (content.Contains("EncryptionDetailSecretKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailSecretKeyVaultId = (string) content.GetValueForProperty("EncryptionDetailSecretKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailSecretKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("IdentityInfoIsSystemAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityInfoIsSystemAssignedIdentity = (bool?) content.GetValueForProperty("IdentityInfoIsSystemAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityInfoIsSystemAssignedIdentity, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IdentityInfoManagedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityInfoManagedIdentityResourceId = (string) content.GetValueForProperty("IdentityInfoManagedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityInfoManagedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("IdentityBasedRestoreDetailTargetStorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityBasedRestoreDetailTargetStorageAccountId = (string) content.GetValueForProperty("IdentityBasedRestoreDetailTargetStorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityBasedRestoreDetailTargetStorageAccountId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IaasVMRestoreRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptionDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetails) content.GetValueForProperty("EncryptionDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.EncryptionDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfo) content.GetValueForProperty("IdentityInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityBasedRestoreDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityBasedRestoreDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetails) content.GetValueForProperty("IdentityBasedRestoreDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityBasedRestoreDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IdentityBasedRestoreDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("RecoveryPointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RecoveryPointId = (string) content.GetValueForProperty("RecoveryPointId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RecoveryPointId, global::System.Convert.ToString); + } + if (content.Contains("RecoveryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RecoveryType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType?) content.GetValueForProperty("RecoveryType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RecoveryType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryType.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("TargetVirtualMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).TargetVirtualMachineId = (string) content.GetValueForProperty("TargetVirtualMachineId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).TargetVirtualMachineId, global::System.Convert.ToString); + } + if (content.Contains("TargetResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).TargetResourceGroupId = (string) content.GetValueForProperty("TargetResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).TargetResourceGroupId, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("VirtualNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).VirtualNetworkId = (string) content.GetValueForProperty("VirtualNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).VirtualNetworkId, global::System.Convert.ToString); + } + if (content.Contains("SubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).SubnetId = (string) content.GetValueForProperty("SubnetId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).SubnetId, global::System.Convert.ToString); + } + if (content.Contains("TargetDomainNameId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).TargetDomainNameId = (string) content.GetValueForProperty("TargetDomainNameId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).TargetDomainNameId, global::System.Convert.ToString); + } + if (content.Contains("Region")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).Region = (string) content.GetValueForProperty("Region",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).Region, global::System.Convert.ToString); + } + if (content.Contains("AffinityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).AffinityGroup = (string) content.GetValueForProperty("AffinityGroup",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).AffinityGroup, global::System.Convert.ToString); + } + if (content.Contains("CreateNewCloudService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).CreateNewCloudService = (bool?) content.GetValueForProperty("CreateNewCloudService",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).CreateNewCloudService, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OriginalStorageAccountOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).OriginalStorageAccountOption = (bool?) content.GetValueForProperty("OriginalStorageAccountOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).OriginalStorageAccountOption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RestoreDiskLunList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RestoreDiskLunList = (int[]) content.GetValueForProperty("RestoreDiskLunList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RestoreDiskLunList, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("RestoreWithManagedDisk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RestoreWithManagedDisk = (bool?) content.GetValueForProperty("RestoreWithManagedDisk",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).RestoreWithManagedDisk, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskEncryptionSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).DiskEncryptionSetId = (string) content.GetValueForProperty("DiskEncryptionSetId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).DiskEncryptionSetId, global::System.Convert.ToString); + } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("EncryptionDetailKekUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailKekUrl = (string) content.GetValueForProperty("EncryptionDetailKekUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailKekUrl, global::System.Convert.ToString); + } + if (content.Contains("IdentityBasedRestoreDetailObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityBasedRestoreDetailObjectType = (string) content.GetValueForProperty("IdentityBasedRestoreDetailObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityBasedRestoreDetailObjectType, global::System.Convert.ToString); + } + if (content.Contains("EncryptionDetailEncryptionEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailEncryptionEnabled = (bool?) content.GetValueForProperty("EncryptionDetailEncryptionEnabled",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailEncryptionEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EncryptionDetailSecretKeyUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailSecretKeyUrl = (string) content.GetValueForProperty("EncryptionDetailSecretKeyUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailSecretKeyUrl, global::System.Convert.ToString); + } + if (content.Contains("EncryptionDetailKekVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailKekVaultId = (string) content.GetValueForProperty("EncryptionDetailKekVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailKekVaultId, global::System.Convert.ToString); + } + if (content.Contains("EncryptionDetailSecretKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailSecretKeyVaultId = (string) content.GetValueForProperty("EncryptionDetailSecretKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).EncryptionDetailSecretKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("IdentityInfoIsSystemAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityInfoIsSystemAssignedIdentity = (bool?) content.GetValueForProperty("IdentityInfoIsSystemAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityInfoIsSystemAssignedIdentity, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IdentityInfoManagedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityInfoManagedIdentityResourceId = (string) content.GetValueForProperty("IdentityInfoManagedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityInfoManagedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("IdentityBasedRestoreDetailTargetStorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityBasedRestoreDetailTargetStorageAccountId = (string) content.GetValueForProperty("IdentityBasedRestoreDetailTargetStorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal)this).IdentityBasedRestoreDetailTargetStorageAccountId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// IaaS VM workload-specific restore. + [System.ComponentModel.TypeConverter(typeof(IaasVMRestoreRequestTypeConverter))] + public partial interface IIaasVMRestoreRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRestoreRequest.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRestoreRequest.TypeConverter.cs new file mode 100644 index 000000000000..3cd0e7239ff7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRestoreRequest.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IaasVMRestoreRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IaasVMRestoreRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IaasVMRestoreRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IaasVMRestoreRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRestoreRequest.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRestoreRequest.cs new file mode 100644 index 000000000000..70278e9441f5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// IaaS VM workload-specific restore. + public partial class IaasVMRestoreRequest : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest __restoreRequest = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IEncryptionDetails EncryptionDetail { get => (this._encryptionDetail = this._encryptionDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IEncryptionDetailsInternal)EncryptionDetail).EncryptionEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IEncryptionDetailsInternal)EncryptionDetail).KekUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IEncryptionDetailsInternal)EncryptionDetail).KekVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IEncryptionDetailsInternal)EncryptionDetail).SecretKeyUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IEncryptionDetailsInternal)EncryptionDetail).SecretKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetailsInternal)EncryptionDetail).SecretKeyVaultId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IIdentityBasedRestoreDetails IdentityBasedRestoreDetail { get => (this._identityBasedRestoreDetail = this._identityBasedRestoreDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IIdentityBasedRestoreDetailsInternal)IdentityBasedRestoreDetail).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IIdentityBasedRestoreDetailsInternal)IdentityBasedRestoreDetail).TargetStorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetailsInternal)IdentityBasedRestoreDetail).TargetStorageAccountId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IIdentityInfo IdentityInfo { get => (this._identityInfo = this._identityInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IIdentityInfoInternal)IdentityInfo).IsSystemAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IIdentityInfoInternal)IdentityInfo).ManagedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfoInternal)IdentityInfo).ManagedIdentityResourceId = value ?? null; } + + /// Internal Acessors for EncryptionDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IEncryptionDetails Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal.EncryptionDetail { get => (this._encryptionDetail = this._encryptionDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.EncryptionDetails()); set { {_encryptionDetail = value;} } } + + /// Internal Acessors for IdentityBasedRestoreDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetails Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal.IdentityBasedRestoreDetail { get => (this._identityBasedRestoreDetail = this._identityBasedRestoreDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IdentityBasedRestoreDetails()); set { {_identityBasedRestoreDetail = value;} } } + + /// Internal Acessors for IdentityInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequestInternal.IdentityInfo { get => (this._identityInfo = this._identityInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRestoreRequestInternal)__restoreRequest).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/IaasVMRestoreRequest.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRestoreRequest.json.cs new file mode 100644 index 000000000000..953ee4be1a0f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IaasVMRestoreRequest.json.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IIaasVMRestoreRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIaasVMRestoreRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new IaasVMRestoreRequest(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 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.Api20241115.RestoreRequest(json); + {_encryptionDetail = If( json?.PropertyT("encryptionDetails"), out var __jsonEncryptionDetails) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.EncryptionDetails.FromJson(__jsonEncryptionDetails) : EncryptionDetail;} + {_identityInfo = If( json?.PropertyT("identityInfo"), out var __jsonIdentityInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IdentityInfo.FromJson(__jsonIdentityInfo) : IdentityInfo;} + {_identityBasedRestoreDetail = If( json?.PropertyT("identityBasedRestoreDetails"), out var __jsonIdentityBasedRestoreDetails) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/IdentityBasedRestoreDetails.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityBasedRestoreDetails.PowerShell.cs new file mode 100644 index 000000000000..5606f45d50f0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityBasedRestoreDetails.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// IaaS VM workload specific restore details for restores using managed identity + [System.ComponentModel.TypeConverter(typeof(IdentityBasedRestoreDetailsTypeConverter))] + public partial class IdentityBasedRestoreDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IdentityBasedRestoreDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IdentityBasedRestoreDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IdentityBasedRestoreDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetailsInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetailsInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetStorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetailsInternal)this).TargetStorageAccountId = (string) content.GetValueForProperty("TargetStorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetailsInternal)this).TargetStorageAccountId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IdentityBasedRestoreDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetailsInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetailsInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("TargetStorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetailsInternal)this).TargetStorageAccountId = (string) content.GetValueForProperty("TargetStorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetailsInternal)this).TargetStorageAccountId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// IaaS VM workload specific restore details for restores using managed identity + [System.ComponentModel.TypeConverter(typeof(IdentityBasedRestoreDetailsTypeConverter))] + public partial interface IIdentityBasedRestoreDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityBasedRestoreDetails.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityBasedRestoreDetails.TypeConverter.cs new file mode 100644 index 000000000000..5356937c8961 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityBasedRestoreDetails.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IdentityBasedRestoreDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IdentityBasedRestoreDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IdentityBasedRestoreDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IdentityBasedRestoreDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityBasedRestoreDetails.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityBasedRestoreDetails.cs new file mode 100644 index 000000000000..9cbd455aba83 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IIdentityBasedRestoreDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/IdentityBasedRestoreDetails.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityBasedRestoreDetails.json.cs new file mode 100644 index 000000000000..4d9cbe983e4c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityBasedRestoreDetails.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IIdentityBasedRestoreDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityBasedRestoreDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/IdentityInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityInfo.PowerShell.cs new file mode 100644 index 000000000000..e1dd8574649d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityInfo.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Encapsulates Managed Identity related information + [System.ComponentModel.TypeConverter(typeof(IdentityInfoTypeConverter))] + public partial class IdentityInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IdentityInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IdentityInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IdentityInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IsSystemAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfoInternal)this).IsSystemAssignedIdentity = (bool?) content.GetValueForProperty("IsSystemAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfoInternal)this).IsSystemAssignedIdentity, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ManagedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfoInternal)this).ManagedIdentityResourceId = (string) content.GetValueForProperty("ManagedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfoInternal)this).ManagedIdentityResourceId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IdentityInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IsSystemAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfoInternal)this).IsSystemAssignedIdentity = (bool?) content.GetValueForProperty("IsSystemAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfoInternal)this).IsSystemAssignedIdentity, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ManagedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfoInternal)this).ManagedIdentityResourceId = (string) content.GetValueForProperty("ManagedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfoInternal)this).ManagedIdentityResourceId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Encapsulates Managed Identity related information + [System.ComponentModel.TypeConverter(typeof(IdentityInfoTypeConverter))] + public partial interface IIdentityInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityInfo.TypeConverter.cs new file mode 100644 index 000000000000..4e3a8f6ab681 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IdentityInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IdentityInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IdentityInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IdentityInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityInfo.cs new file mode 100644 index 000000000000..ac1df7e311db --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Encapsulates Managed Identity related information + public partial class IdentityInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/IdentityInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityInfo.json.cs new file mode 100644 index 000000000000..9158b7ce65c8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/IdentityInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IIdentityInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IIdentityInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/InstantItemRecoveryTarget.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/InstantItemRecoveryTarget.PowerShell.cs new file mode 100644 index 000000000000..e56fc059f97d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/InstantItemRecoveryTarget.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Target details for file / folder restore. + [System.ComponentModel.TypeConverter(typeof(InstantItemRecoveryTargetTypeConverter))] + public partial class InstantItemRecoveryTarget + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTarget DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new InstantItemRecoveryTarget(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTarget DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new InstantItemRecoveryTarget(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTarget FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal InstantItemRecoveryTarget(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClientScript")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTargetInternal)this).ClientScript = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnect[]) content.GetValueForProperty("ClientScript",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTargetInternal)this).ClientScript, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ClientScriptForConnectTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal InstantItemRecoveryTarget(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClientScript")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTargetInternal)this).ClientScript = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnect[]) content.GetValueForProperty("ClientScript",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTargetInternal)this).ClientScript, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ClientScriptForConnectTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Target details for file / folder restore. + [System.ComponentModel.TypeConverter(typeof(InstantItemRecoveryTargetTypeConverter))] + public partial interface IInstantItemRecoveryTarget + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/InstantItemRecoveryTarget.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/InstantItemRecoveryTarget.TypeConverter.cs new file mode 100644 index 000000000000..5660804f9b40 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/InstantItemRecoveryTarget.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class InstantItemRecoveryTargetTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTarget ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTarget).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return InstantItemRecoveryTarget.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return InstantItemRecoveryTarget.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return InstantItemRecoveryTarget.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/InstantItemRecoveryTarget.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/InstantItemRecoveryTarget.cs new file mode 100644 index 000000000000..fe08ecffca86 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IInstantItemRecoveryTarget, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTargetInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IClientScriptForConnect) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnect[] ClientScript { get; set; } + + } + /// Target details for file / folder restore. + internal partial interface IInstantItemRecoveryTargetInternal + + { + /// List of client scripts. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnect[] ClientScript { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/InstantItemRecoveryTarget.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/InstantItemRecoveryTarget.json.cs new file mode 100644 index 000000000000..bebbcb09a7d9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/InstantItemRecoveryTarget.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IInstantItemRecoveryTarget. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTarget. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IClientScriptForConnect) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/Job.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Job.PowerShell.cs new file mode 100644 index 000000000000..f3936befa4e9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Job.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Defines workload agnostic properties for a job. + [System.ComponentModel.TypeConverter(typeof(JobTypeConverter))] + public partial class Job + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJob DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Job(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJob DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Job(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJob FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Job(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EntityFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName = (string) content.GetValueForProperty("EntityFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActivityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId = (string) content.GetValueForProperty("ActivityId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Job(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EntityFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName = (string) content.GetValueForProperty("EntityFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActivityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId = (string) content.GetValueForProperty("ActivityId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Defines workload agnostic properties for a job. + [System.ComponentModel.TypeConverter(typeof(JobTypeConverter))] + public partial interface IJob + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Job.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Job.TypeConverter.cs new file mode 100644 index 000000000000..8888b0b34065 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Job.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JobTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJob ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJob).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Job.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Job.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Job.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Job.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Job.cs new file mode 100644 index 000000000000..de420914e360 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IJob, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/Job.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Job.json.cs new file mode 100644 index 000000000000..75736553d5ed --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Job.json.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IJob. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 "AzureStorageJob": + { + return new AzureStorageJob(json); + } + case "AzureWorkloadJob": + { + return new AzureWorkloadJob(json); + } + case "DpmJob": + { + return new DpmJob(json); + } + case "MabJob": + { + return new MabJob(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.DefaultTag/generated/api/Models/Api20241115/JobQueryObject.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobQueryObject.PowerShell.cs new file mode 100644 index 000000000000..0ac242132fa6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobQueryObject.PowerShell.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Filters to list the jobs. + [System.ComponentModel.TypeConverter(typeof(JobQueryObjectTypeConverter))] + public partial class JobQueryObject + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObject DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JobQueryObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObject DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JobQueryObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObject FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JobQueryObject(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus.CreateFrom); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).Operation = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType?) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).Operation, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType.CreateFrom); + } + if (content.Contains("JobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).JobId = (string) content.GetValueForProperty("JobId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).JobId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JobQueryObject(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatus.CreateFrom); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).Operation = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType?) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).Operation, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationType.CreateFrom); + } + if (content.Contains("JobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).JobId = (string) content.GetValueForProperty("JobId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).JobId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObjectInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Filters to list the jobs. + [System.ComponentModel.TypeConverter(typeof(JobQueryObjectTypeConverter))] + public partial interface IJobQueryObject + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobQueryObject.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobQueryObject.TypeConverter.cs new file mode 100644 index 000000000000..a406849d9752 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobQueryObject.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JobQueryObjectTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObject ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObject).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return JobQueryObject.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return JobQueryObject.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return JobQueryObject.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobQueryObject.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobQueryObject.cs new file mode 100644 index 000000000000..e72789a87d7b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list the jobs. + public partial class JobQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/JobQueryObject.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobQueryObject.json.cs new file mode 100644 index 000000000000..ad9baefe2301 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobQueryObject.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IJobQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/JobResource.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResource.PowerShell.cs new file mode 100644 index 000000000000..88de172f5392 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResource.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Defines workload agnostic properties for a job. + [System.ComponentModel.TypeConverter(typeof(JobResourceTypeConverter))] + public partial class JobResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JobResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JobResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JobResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJob) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.JobTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).JobType = (string) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).JobType, global::System.Convert.ToString); + } + if (content.Contains("EntityFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).EntityFriendlyName = (string) content.GetValueForProperty("EntityFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).EntityFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActivityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).ActivityId = (string) content.GetValueForProperty("ActivityId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).ActivityId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JobResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJob) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.JobTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).JobType = (string) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).JobType, global::System.Convert.ToString); + } + if (content.Contains("EntityFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).EntityFriendlyName = (string) content.GetValueForProperty("EntityFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).EntityFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActivityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).ActivityId = (string) content.GetValueForProperty("ActivityId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal)this).ActivityId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Defines workload agnostic properties for a job. + [System.ComponentModel.TypeConverter(typeof(JobResourceTypeConverter))] + public partial interface IJobResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResource.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResource.TypeConverter.cs new file mode 100644 index 000000000000..af898fc1b3ce --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResource.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JobResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return JobResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return JobResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return JobResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResource.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResource.cs new file mode 100644 index 000000000000..1c6ef28e905b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IJobResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)Property).ActivityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)Property).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)Property).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)Property).EntityFriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IJobInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJob Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.Job()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IJobInternal)Property).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)Property).Operation = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJob _property; + + /// JobResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJob Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)Property).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/JobResource.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResource.json.cs new file mode 100644 index 000000000000..8c8065054918 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResource.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IJobResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/JobResourceList.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResourceList.PowerShell.cs new file mode 100644 index 000000000000..80fdb6b9a205 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResourceList.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// List of Job resources + [System.ComponentModel.TypeConverter(typeof(JobResourceListTypeConverter))] + public partial class JobResourceList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JobResourceList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JobResourceList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JobResourceList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.JobResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JobResourceList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.JobResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// List of Job resources + [System.ComponentModel.TypeConverter(typeof(JobResourceListTypeConverter))] + public partial interface IJobResourceList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResourceList.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResourceList.TypeConverter.cs new file mode 100644 index 000000000000..cc63bbc6cc36 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResourceList.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JobResourceListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return JobResourceList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return JobResourceList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return JobResourceList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResourceList.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResourceList.cs new file mode 100644 index 000000000000..9aba7b831263 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of Job resources + public partial class JobResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceListInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceList __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceListInternal)__resourceList).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)__resourceList).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.IJobResource) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource[] Value { get; set; } + + } + /// List of Job resources + internal partial interface IJobResourceListInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal + { + /// List of resources. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResourceList.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResourceList.json.cs new file mode 100644 index 000000000000..f67edb2c16c1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/JobResourceList.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IJobResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IJobResource) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/KekDetails.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KekDetails.PowerShell.cs new file mode 100644 index 000000000000..18014c85f188 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KekDetails.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// KEK is encryption key for BEK. + [System.ComponentModel.TypeConverter(typeof(KekDetailsTypeConverter))] + public partial class KekDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KekDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KekDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KekDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetailsInternal)this).KeyUrl = (string) content.GetValueForProperty("KeyUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetailsInternal)this).KeyUrl, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetailsInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetailsInternal)this).KeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("KeyBackupData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetailsInternal)this).KeyBackupData = (string) content.GetValueForProperty("KeyBackupData",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetailsInternal)this).KeyBackupData, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KekDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetailsInternal)this).KeyUrl = (string) content.GetValueForProperty("KeyUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetailsInternal)this).KeyUrl, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetailsInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetailsInternal)this).KeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("KeyBackupData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetailsInternal)this).KeyBackupData = (string) content.GetValueForProperty("KeyBackupData",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetailsInternal)this).KeyBackupData, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// KEK is encryption key for BEK. + [System.ComponentModel.TypeConverter(typeof(KekDetailsTypeConverter))] + public partial interface IKekDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KekDetails.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KekDetails.TypeConverter.cs new file mode 100644 index 000000000000..0a5638453c3e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KekDetails.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KekDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KekDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KekDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KekDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KekDetails.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KekDetails.cs new file mode 100644 index 000000000000..e03b8a5617a8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IKekDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/KekDetails.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KekDetails.json.cs new file mode 100644 index 000000000000..2753d2d8833a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KekDetails.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IKekDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/KeyAndSecretDetails.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KeyAndSecretDetails.PowerShell.cs new file mode 100644 index 000000000000..4631e19446c9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KeyAndSecretDetails.PowerShell.cs @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// 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. + /// + [System.ComponentModel.TypeConverter(typeof(KeyAndSecretDetailsTypeConverter))] + public partial class KeyAndSecretDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KeyAndSecretDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KeyAndSecretDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KeyAndSecretDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KekDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetails) content.GetValueForProperty("KekDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.KekDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("BekDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetails) content.GetValueForProperty("BekDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BekDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionMechanism")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).EncryptionMechanism = (string) content.GetValueForProperty("EncryptionMechanism",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).EncryptionMechanism, global::System.Convert.ToString); + } + if (content.Contains("KekDetailKeyUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetailKeyUrl = (string) content.GetValueForProperty("KekDetailKeyUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetailKeyUrl, global::System.Convert.ToString); + } + if (content.Contains("BekDetailSecretUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetailSecretUrl = (string) content.GetValueForProperty("BekDetailSecretUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetailSecretUrl, global::System.Convert.ToString); + } + if (content.Contains("BekDetailSecretData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetailSecretData = (string) content.GetValueForProperty("BekDetailSecretData",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetailSecretData, global::System.Convert.ToString); + } + if (content.Contains("KekDetailKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetailKeyVaultId = (string) content.GetValueForProperty("KekDetailKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetailKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("KekDetailKeyBackupData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetailKeyBackupData = (string) content.GetValueForProperty("KekDetailKeyBackupData",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetailKeyBackupData, global::System.Convert.ToString); + } + if (content.Contains("BekDetailSecretVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetailSecretVaultId = (string) content.GetValueForProperty("BekDetailSecretVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetailSecretVaultId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KeyAndSecretDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KekDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetails) content.GetValueForProperty("KekDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.KekDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("BekDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetails) content.GetValueForProperty("BekDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetail, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BekDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionMechanism")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).EncryptionMechanism = (string) content.GetValueForProperty("EncryptionMechanism",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).EncryptionMechanism, global::System.Convert.ToString); + } + if (content.Contains("KekDetailKeyUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetailKeyUrl = (string) content.GetValueForProperty("KekDetailKeyUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetailKeyUrl, global::System.Convert.ToString); + } + if (content.Contains("BekDetailSecretUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetailSecretUrl = (string) content.GetValueForProperty("BekDetailSecretUrl",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetailSecretUrl, global::System.Convert.ToString); + } + if (content.Contains("BekDetailSecretData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetailSecretData = (string) content.GetValueForProperty("BekDetailSecretData",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetailSecretData, global::System.Convert.ToString); + } + if (content.Contains("KekDetailKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetailKeyVaultId = (string) content.GetValueForProperty("KekDetailKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetailKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("KekDetailKeyBackupData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetailKeyBackupData = (string) content.GetValueForProperty("KekDetailKeyBackupData",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).KekDetailKeyBackupData, global::System.Convert.ToString); + } + if (content.Contains("BekDetailSecretVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetailSecretVaultId = (string) content.GetValueForProperty("BekDetailSecretVaultId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal)this).BekDetailSecretVaultId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// 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. + [System.ComponentModel.TypeConverter(typeof(KeyAndSecretDetailsTypeConverter))] + public partial interface IKeyAndSecretDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KeyAndSecretDetails.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KeyAndSecretDetails.TypeConverter.cs new file mode 100644 index 000000000000..d00490d64d3a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KeyAndSecretDetails.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KeyAndSecretDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KeyAndSecretDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KeyAndSecretDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KeyAndSecretDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KeyAndSecretDetails.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KeyAndSecretDetails.cs new file mode 100644 index 000000000000..ac524d71b387 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IKeyAndSecretDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IBekDetails BekDetail { get => (this._bekDetail = this._bekDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IBekDetailsInternal)BekDetail).SecretData; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IBekDetailsInternal)BekDetail).SecretUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IBekDetailsInternal)BekDetail).SecretVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IKekDetails KekDetail { get => (this._kekDetail = this._kekDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IKekDetailsInternal)KekDetail).KeyBackupData; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IKekDetailsInternal)KekDetail).KeyUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IKekDetailsInternal)KekDetail).KeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetailsInternal)KekDetail).KeyVaultId = value ?? null; } + + /// Internal Acessors for BekDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBekDetails Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal.BekDetail { get => (this._bekDetail = this._bekDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BekDetails()); set { {_bekDetail = value;} } } + + /// Internal Acessors for KekDetail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKekDetails Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetailsInternal.KekDetail { get => (this._kekDetail = this._kekDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/KeyAndSecretDetails.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KeyAndSecretDetails.json.cs new file mode 100644 index 000000000000..4a6b1bc773e2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KeyAndSecretDetails.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IKeyAndSecretDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKeyAndSecretDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.KekDetails.FromJson(__jsonKekDetails) : KekDetail;} + {_bekDetail = If( json?.PropertyT("bekDetails"), out var __jsonBekDetails) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/KpiResourceHealthDetails.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KpiResourceHealthDetails.PowerShell.cs new file mode 100644 index 000000000000..b4ff69cc49d5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KpiResourceHealthDetails.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// KPI Resource Health Details + [System.ComponentModel.TypeConverter(typeof(KpiResourceHealthDetailsTypeConverter))] + public partial class KpiResourceHealthDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KpiResourceHealthDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KpiResourceHealthDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KpiResourceHealthDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceHealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetailsInternal)this).ResourceHealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus?) content.GetValueForProperty("ResourceHealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetailsInternal)this).ResourceHealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus.CreateFrom); + } + if (content.Contains("ResourceHealthDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetailsInternal)this).ResourceHealthDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails[]) content.GetValueForProperty("ResourceHealthDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetailsInternal)this).ResourceHealthDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceHealthDetailsTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KpiResourceHealthDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceHealthStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetailsInternal)this).ResourceHealthStatus = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus?) content.GetValueForProperty("ResourceHealthStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetailsInternal)this).ResourceHealthStatus, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatus.CreateFrom); + } + if (content.Contains("ResourceHealthDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetailsInternal)this).ResourceHealthDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails[]) content.GetValueForProperty("ResourceHealthDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetailsInternal)this).ResourceHealthDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceHealthDetailsTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// KPI Resource Health Details + [System.ComponentModel.TypeConverter(typeof(KpiResourceHealthDetailsTypeConverter))] + public partial interface IKpiResourceHealthDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KpiResourceHealthDetails.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KpiResourceHealthDetails.TypeConverter.cs new file mode 100644 index 000000000000..8b1bce3dc899 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KpiResourceHealthDetails.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KpiResourceHealthDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KpiResourceHealthDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KpiResourceHealthDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KpiResourceHealthDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KpiResourceHealthDetails.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KpiResourceHealthDetails.cs new file mode 100644 index 000000000000..6db6ef28dba4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// KPI Resource Health Details + public partial class KpiResourceHealthDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetailsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IResourceHealthDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/KpiResourceHealthDetails.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KpiResourceHealthDetails.json.cs new file mode 100644 index 000000000000..964989a983cd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/KpiResourceHealthDetails.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IKpiResourceHealthDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IKpiResourceHealthDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceHealthDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/MabErrorInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabErrorInfo.PowerShell.cs new file mode 100644 index 000000000000..cd82ffa5b7b2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabErrorInfo.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// MAB workload-specific error information. + [System.ComponentModel.TypeConverter(typeof(MabErrorInfoTypeConverter))] + public partial class MabErrorInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MabErrorInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MabErrorInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MabErrorInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfoInternal)this).ErrorString = (string) content.GetValueForProperty("ErrorString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfoInternal)this).ErrorString, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfoInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfoInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MabErrorInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfoInternal)this).ErrorString = (string) content.GetValueForProperty("ErrorString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfoInternal)this).ErrorString, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfoInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfoInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// MAB workload-specific error information. + [System.ComponentModel.TypeConverter(typeof(MabErrorInfoTypeConverter))] + public partial interface IMabErrorInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabErrorInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabErrorInfo.TypeConverter.cs new file mode 100644 index 000000000000..9aa86cd433fc --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabErrorInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MabErrorInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MabErrorInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MabErrorInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MabErrorInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabErrorInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabErrorInfo.cs new file mode 100644 index 000000000000..9cacbe8de708 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// MAB workload-specific error information. + public partial class MabErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabErrorInfoInternal.ErrorString { get => this._errorString; set { {_errorString = value;} } } + + /// Internal Acessors for Recommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/MabErrorInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabErrorInfo.json.cs new file mode 100644 index 000000000000..a542b0969332 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabErrorInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IMabErrorInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItem.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItem.PowerShell.cs new file mode 100644 index 000000000000..639d01fed2df --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItem.PowerShell.cs @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// MAB workload-specific backup item. + [System.ComponentModel.TypeConverter(typeof(MabFileFolderProtectedItemTypeConverter))] + public partial class MabFileFolderProtectedItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MabFileFolderProtectedItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MabFileFolderProtectedItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MabFileFolderProtectedItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabFileFolderProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("ComputerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ComputerName = (string) content.GetValueForProperty("ComputerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ComputerName, global::System.Convert.ToString); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).LastBackupStatus = (string) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).LastBackupStatus, global::System.Convert.ToString); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ProtectionState = (string) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ProtectionState, global::System.Convert.ToString); + } + if (content.Contains("DeferredDeleteSyncTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).DeferredDeleteSyncTimeInUtc = (long?) content.GetValueForProperty("DeferredDeleteSyncTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).DeferredDeleteSyncTimeInUtc, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoLastRefreshedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfoLastRefreshedAt = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoLastRefreshedAt",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfoLastRefreshedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MabFileFolderProtectedItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabFileFolderProtectedItemExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("ComputerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ComputerName = (string) content.GetValueForProperty("ComputerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ComputerName, global::System.Convert.ToString); + } + if (content.Contains("LastBackupStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).LastBackupStatus = (string) content.GetValueForProperty("LastBackupStatus",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).LastBackupStatus, global::System.Convert.ToString); + } + if (content.Contains("LastBackupTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).LastBackupTime = (global::System.DateTime?) content.GetValueForProperty("LastBackupTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).LastBackupTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ProtectionState = (string) content.GetValueForProperty("ProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ProtectionState, global::System.Convert.ToString); + } + if (content.Contains("DeferredDeleteSyncTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).DeferredDeleteSyncTimeInUtc = (long?) content.GetValueForProperty("DeferredDeleteSyncTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).DeferredDeleteSyncTimeInUtc, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExtendedInfoLastRefreshedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfoLastRefreshedAt = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoLastRefreshedAt",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfoLastRefreshedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoOldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("ExtendedInfoOldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfoOldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExtendedInfoRecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfoRecoveryPointCount = (int?) content.GetValueForProperty("ExtendedInfoRecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal)this).ExtendedInfoRecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// MAB workload-specific backup item. + [System.ComponentModel.TypeConverter(typeof(MabFileFolderProtectedItemTypeConverter))] + public partial interface IMabFileFolderProtectedItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItem.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItem.TypeConverter.cs new file mode 100644 index 000000000000..bffa181a0761 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItem.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MabFileFolderProtectedItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MabFileFolderProtectedItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MabFileFolderProtectedItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MabFileFolderProtectedItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItem.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItem.cs new file mode 100644 index 000000000000..854901e02baa --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItem.cs @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// MAB workload-specific backup item. + public partial class MabFileFolderProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem __protectedItem = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).DeferredDeleteTimeRemaining = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabFileFolderProtectedItemExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabFileFolderProtectedItemExtendedInfoInternal)ExtendedInfo).LastRefreshedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabFileFolderProtectedItemExtendedInfoInternal)ExtendedInfo).OldestRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabFileFolderProtectedItemExtendedInfoInternal)ExtendedInfo).RecoveryPointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 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.Api20241115.IProtectedItemInternal)__protectedItem).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).LastRecoveryPoint = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExtendedInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)__protectedItem).PolicyId = 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.Api20241115.IProtectedItemInternal)__protectedItem).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)__protectedItem).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItem.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItem.json.cs new file mode 100644 index 000000000000..3e1a3ad1c31b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItem.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IMabFileFolderProtectedItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.ProtectedItem(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItemExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItemExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..3a378ff51402 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItemExtendedInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Additional information on the backed up item. + [System.ComponentModel.TypeConverter(typeof(MabFileFolderProtectedItemExtendedInfoTypeConverter))] + public partial class MabFileFolderProtectedItemExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MabFileFolderProtectedItemExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MabFileFolderProtectedItemExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MabFileFolderProtectedItemExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LastRefreshedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfoInternal)this).LastRefreshedAt = (global::System.DateTime?) content.GetValueForProperty("LastRefreshedAt",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfoInternal)this).LastRefreshedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfoInternal)this).RecoveryPointCount = (int?) content.GetValueForProperty("RecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfoInternal)this).RecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MabFileFolderProtectedItemExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LastRefreshedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfoInternal)this).LastRefreshedAt = (global::System.DateTime?) content.GetValueForProperty("LastRefreshedAt",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfoInternal)this).LastRefreshedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OldestRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("OldestRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfoInternal)this).OldestRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecoveryPointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfoInternal)this).RecoveryPointCount = (int?) content.GetValueForProperty("RecoveryPointCount",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfoInternal)this).RecoveryPointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Additional information on the backed up item. + [System.ComponentModel.TypeConverter(typeof(MabFileFolderProtectedItemExtendedInfoTypeConverter))] + public partial interface IMabFileFolderProtectedItemExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItemExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItemExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..9fa5e6d21bf6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItemExtendedInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MabFileFolderProtectedItemExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MabFileFolderProtectedItemExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MabFileFolderProtectedItemExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MabFileFolderProtectedItemExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItemExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..d01fc40c30ad --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IMabFileFolderProtectedItemExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItemExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItemExtendedInfo.json.cs new file mode 100644 index 000000000000..bb9b02c0c361 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabFileFolderProtectedItemExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IMabFileFolderProtectedItemExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabFileFolderProtectedItemExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/MabJob.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJob.PowerShell.cs new file mode 100644 index 000000000000..26a0a4f5e464 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJob.PowerShell.cs @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// MAB workload-specific job. + [System.ComponentModel.TypeConverter(typeof(MabJobTypeConverter))] + public partial class MabJob + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJob DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MabJob(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJob DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MabJob(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJob FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MabJob(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("ActionsInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ActionsInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[]) content.GetValueForProperty("ActionsInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ActionsInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction.CreateFrom)); + } + if (content.Contains("MabServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).MabServerName = (string) content.GetValueForProperty("MabServerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).MabServerName, global::System.Convert.ToString); + } + if (content.Contains("MabServerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).MabServerType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType?) content.GetValueForProperty("MabServerType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).MabServerType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType.CreateFrom); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfo[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabErrorInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("EntityFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName = (string) content.GetValueForProperty("EntityFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActivityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId = (string) content.GetValueForProperty("ActivityId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoTasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfoTasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetails[]) content.GetValueForProperty("ExtendedInfoTasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfoTasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedInfoPropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfoPropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoPropertyBag) content.GetValueForProperty("ExtendedInfoPropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfoPropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoDynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfoDynamicErrorMessage = (string) content.GetValueForProperty("ExtendedInfoDynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfoDynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MabJob(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("ActionsInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ActionsInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction[]) content.GetValueForProperty("ActionsInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ActionsInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedAction.CreateFrom)); + } + if (content.Contains("MabServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).MabServerName = (string) content.GetValueForProperty("MabServerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).MabServerName, global::System.Convert.ToString); + } + if (content.Contains("MabServerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).MabServerType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType?) content.GetValueForProperty("MabServerType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).MabServerType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadType.CreateFrom); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfo[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabErrorInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("EntityFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName = (string) content.GetValueForProperty("EntityFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EntityFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ActivityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId = (string) content.GetValueForProperty("ActivityId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).ActivityId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExtendedInfoTasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfoTasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetails[]) content.GetValueForProperty("ExtendedInfoTasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfoTasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedInfoPropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfoPropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoPropertyBag) content.GetValueForProperty("ExtendedInfoPropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfoPropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedInfoDynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfoDynamicErrorMessage = (string) content.GetValueForProperty("ExtendedInfoDynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal)this).ExtendedInfoDynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// MAB workload-specific job. + [System.ComponentModel.TypeConverter(typeof(MabJobTypeConverter))] + public partial interface IMabJob + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJob.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJob.TypeConverter.cs new file mode 100644 index 000000000000..e2d9fab97f4a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJob.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MabJobTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJob ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJob).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MabJob.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MabJob.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MabJob.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJob.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJob.cs new file mode 100644 index 000000000000..438d465a458b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// MAB workload-specific job. + public partial class MabJob : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJob, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJob __job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).ActivityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).EntityFriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobInternal)__job).EntityFriendlyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfo[] _errorDetail; + + /// The errors. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabErrorInfo[] ErrorDetail { get => this._errorDetail; set => this._errorDetail = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabJobExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabJobExtendedInfoInternal)ExtendedInfo).DynamicErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoInternal)ExtendedInfo).PropertyBag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabJobTaskDetails[] ExtendedInfoTasksList { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoInternal)ExtendedInfo).TasksList; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabJobExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobInternal.ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IJobInternal)__job).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IMabErrorInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IMabErrorInfo[] ErrorDetail { get; set; } + /// Additional information on the job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabJobExtendedInfoPropertyBag ExtendedInfoPropertyBag { get; set; } + /// List of tasks for this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/MabJob.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJob.json.cs new file mode 100644 index 000000000000..7a4153ad8e19 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJob.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IMabJob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.Job(json); + {_extendedInfo = If( json?.PropertyT("extendedInfo"), out var __jsonExtendedInfo) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabErrorInfo) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..40084c354835 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Additional information for the MAB workload-specific job. + [System.ComponentModel.TypeConverter(typeof(MabJobExtendedInfoTypeConverter))] + public partial class MabJobExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MabJobExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MabJobExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MabJobExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoInternal)this).TasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetails[]) content.GetValueForProperty("TasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoInternal)this).TasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("DynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoInternal)this).DynamicErrorMessage = (string) content.GetValueForProperty("DynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoInternal)this).DynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MabJobExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TasksList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoInternal)this).TasksList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetails[]) content.GetValueForProperty("TasksList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoInternal)this).TasksList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobTaskDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("PropertyBag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoInternal)this).PropertyBag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoPropertyBag) content.GetValueForProperty("PropertyBag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoInternal)this).PropertyBag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobExtendedInfoPropertyBagTypeConverter.ConvertFrom); + } + if (content.Contains("DynamicErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoInternal)this).DynamicErrorMessage = (string) content.GetValueForProperty("DynamicErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoInternal)this).DynamicErrorMessage, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Additional information for the MAB workload-specific job. + [System.ComponentModel.TypeConverter(typeof(MabJobExtendedInfoTypeConverter))] + public partial interface IMabJobExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..843d78156f7e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MabJobExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MabJobExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MabJobExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MabJobExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfo.cs new file mode 100644 index 000000000000..300b5eea78fb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IMabJobExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IMabJobExtendedInfoPropertyBag PropertyBag { get => (this._propertyBag = this._propertyBag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobExtendedInfoPropertyBag()); set => this._propertyBag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IMabJobExtendedInfoPropertyBag) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabJobTaskDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabJobExtendedInfoPropertyBag PropertyBag { get; set; } + /// List of tasks for this job. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetails[] TasksList { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfo.json.cs new file mode 100644 index 000000000000..622968cdf65f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IMabJobExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IMabJobTaskDetails) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.MabJobTaskDetails.FromJson(__u) )) ))() : null : TasksList;} + {_propertyBag = If( json?.PropertyT("propertyBag"), out var __jsonPropertyBag) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfoPropertyBag.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfoPropertyBag.PowerShell.cs new file mode 100644 index 000000000000..30e9abb782cf --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfoPropertyBag.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// The job properties. + [System.ComponentModel.TypeConverter(typeof(MabJobExtendedInfoPropertyBagTypeConverter))] + public partial class MabJobExtendedInfoPropertyBag + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoPropertyBag DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MabJobExtendedInfoPropertyBag(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoPropertyBag DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MabJobExtendedInfoPropertyBag(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoPropertyBag FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MabJobExtendedInfoPropertyBag(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MabJobExtendedInfoPropertyBag(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The job properties. + [System.ComponentModel.TypeConverter(typeof(MabJobExtendedInfoPropertyBagTypeConverter))] + public partial interface IMabJobExtendedInfoPropertyBag + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfoPropertyBag.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfoPropertyBag.TypeConverter.cs new file mode 100644 index 000000000000..bd3d66fcd2e4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfoPropertyBag.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MabJobExtendedInfoPropertyBagTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoPropertyBag ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoPropertyBag).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MabJobExtendedInfoPropertyBag.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MabJobExtendedInfoPropertyBag.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MabJobExtendedInfoPropertyBag.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfoPropertyBag.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfoPropertyBag.cs new file mode 100644 index 000000000000..b08219dfbf04 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The job properties. + public partial class MabJobExtendedInfoPropertyBag : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoPropertyBag, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfoPropertyBag.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfoPropertyBag.dictionary.cs new file mode 100644 index 000000000000..2422c625243d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.MabJobExtendedInfoPropertyBag source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfoPropertyBag.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfoPropertyBag.json.cs new file mode 100644 index 000000000000..8b4e03a5e006 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobExtendedInfoPropertyBag.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IMabJobExtendedInfoPropertyBag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobExtendedInfoPropertyBag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/MabJobTaskDetails.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobTaskDetails.PowerShell.cs new file mode 100644 index 000000000000..b31fc3d7954a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobTaskDetails.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// MAB workload-specific job task details. + [System.ComponentModel.TypeConverter(typeof(MabJobTaskDetailsTypeConverter))] + public partial class MabJobTaskDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MabJobTaskDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MabJobTaskDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MabJobTaskDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).Status, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MabJobTaskDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TaskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).TaskId = (string) content.GetValueForProperty("TaskId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).TaskId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Duration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).Duration = (global::System.TimeSpan?) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).Duration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetailsInternal)this).Status, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// MAB workload-specific job task details. + [System.ComponentModel.TypeConverter(typeof(MabJobTaskDetailsTypeConverter))] + public partial interface IMabJobTaskDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobTaskDetails.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobTaskDetails.TypeConverter.cs new file mode 100644 index 000000000000..91eb4757a91d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobTaskDetails.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MabJobTaskDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MabJobTaskDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MabJobTaskDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MabJobTaskDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobTaskDetails.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobTaskDetails.cs new file mode 100644 index 000000000000..085512fb83e1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IMabJobTaskDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/MabJobTaskDetails.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobTaskDetails.json.cs new file mode 100644 index 000000000000..19b0ec54d7a0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/MabJobTaskDetails.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IMabJobTaskDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IMabJobTaskDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/NameInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NameInfo.PowerShell.cs new file mode 100644 index 000000000000..1a2e2b4f1143 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NameInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// The name of usage. + [System.ComponentModel.TypeConverter(typeof(NameInfoTypeConverter))] + public partial class NameInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NameInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NameInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NameInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfoInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfoInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("LocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfoInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfoInternal)this).LocalizedValue, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NameInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfoInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfoInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("LocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfoInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfoInternal)this).LocalizedValue, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The name of usage. + [System.ComponentModel.TypeConverter(typeof(NameInfoTypeConverter))] + public partial interface INameInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NameInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NameInfo.TypeConverter.cs new file mode 100644 index 000000000000..7c297aa56e2a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NameInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NameInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NameInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NameInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NameInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NameInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NameInfo.cs new file mode 100644 index 000000000000..11f0c1790395 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The name of usage. + public partial class NameInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/NameInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NameInfo.json.cs new file mode 100644 index 000000000000..d8ded33ab8c1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NameInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.INameInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INameInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/NewErrorResponse.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponse.PowerShell.cs new file mode 100644 index 000000000000..ca87cdb168c2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponse.PowerShell.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// The resource management error response. + [System.ComponentModel.TypeConverter(typeof(NewErrorResponseTypeConverter))] + public partial class NewErrorResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NewErrorResponse(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NewErrorResponse(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NewErrorResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.NewErrorResponseErrorTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.NewErrorResponseTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NewErrorResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.NewErrorResponseErrorTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.NewErrorResponseTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The resource management error response. + [System.ComponentModel.TypeConverter(typeof(NewErrorResponseTypeConverter))] + public partial interface INewErrorResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponse.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponse.TypeConverter.cs new file mode 100644 index 000000000000..273e2a80f369 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponse.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NewErrorResponseTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NewErrorResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NewErrorResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NewErrorResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponse.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponse.cs new file mode 100644 index 000000000000..c8b1d451b71a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The resource management error response. + public partial class NewErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.INewErrorResponse[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)Error).Detail; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.INewErrorResponseError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.INewErrorResponseErrorInternal)Error).Message; } + + /// Internal Acessors for AdditionalInfo + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)Error).AdditionalInfo = value; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)Error).Code = value; } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)Error).Detail = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseError Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.NewErrorResponseError()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)Error).Message = value; } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.INewErrorResponse) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.INewErrorResponse[] Detail { get; set; } + /// The error object. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/NewErrorResponse.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponse.json.cs new file mode 100644 index 000000000000..a5c653be248c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponse.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.INewErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/NewErrorResponseError.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponseError.PowerShell.cs new file mode 100644 index 000000000000..13b9c576529d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponseError.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// The error object. + [System.ComponentModel.TypeConverter(typeof(NewErrorResponseErrorTypeConverter))] + public partial class NewErrorResponseError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NewErrorResponseError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NewErrorResponseError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NewErrorResponseError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.NewErrorResponseTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NewErrorResponseError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.NewErrorResponseTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api10.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The error object. + [System.ComponentModel.TypeConverter(typeof(NewErrorResponseErrorTypeConverter))] + public partial interface INewErrorResponseError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponseError.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponseError.TypeConverter.cs new file mode 100644 index 000000000000..4f07cd083aab --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponseError.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NewErrorResponseErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NewErrorResponseError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NewErrorResponseError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NewErrorResponseError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponseError.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponseError.cs new file mode 100644 index 000000000000..ea350f115575 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// The error object. + public partial class NewErrorResponseError : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseError, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.INewErrorResponseErrorInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal.Detail { get => this._detail; set { {_detail = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseErrorInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.INewErrorResponse) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/NewErrorResponseError.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponseError.json.cs new file mode 100644 index 000000000000..7290f2e7fa0f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/NewErrorResponseError.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.INewErrorResponseError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponseError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.INewErrorResponse) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/OperationStatus.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatus.PowerShell.cs new file mode 100644 index 000000000000..af478096a681 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatus.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Operation status. + [System.ComponentModel.TypeConverter(typeof(OperationStatusTypeConverter))] + public partial class OperationStatus + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationStatus(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationStatus(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationStatus(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusErrorTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfo) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues.CreateFrom); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).ObjectType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationStatus(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusErrorTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfo) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusExtendedInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValues.CreateFrom); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal)this).ObjectType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Operation status. + [System.ComponentModel.TypeConverter(typeof(OperationStatusTypeConverter))] + public partial interface IOperationStatus + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatus.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatus.TypeConverter.cs new file mode 100644 index 000000000000..c07c8b8397aa --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatus.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationStatusTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationStatus.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationStatus.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationStatus.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatus.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatus.cs new file mode 100644 index 000000000000..e05720c27afb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation status. + public partial class OperationStatus : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IOperationStatusErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IOperationStatusError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IOperationStatusErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusErrorInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusError Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusError()); set { {_error = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfo Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IOperationStatusExtendedInfoInternal)Property).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)Property).ObjectType = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IOperationStatusExtendedInfo Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/OperationStatus.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatus.json.cs new file mode 100644 index 000000000000..2a38d5aac999 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatus.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IOperationStatus. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.OperationStatusError.FromJson(__jsonError) : Error;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/OperationStatusError.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusError.PowerShell.cs new file mode 100644 index 000000000000..582005fa8ffa --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusError.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Error information associated with operation status call. + [System.ComponentModel.TypeConverter(typeof(OperationStatusErrorTypeConverter))] + public partial class OperationStatusError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationStatusError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationStatusError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationStatusError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusErrorInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationStatusError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusErrorInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Error information associated with operation status call. + [System.ComponentModel.TypeConverter(typeof(OperationStatusErrorTypeConverter))] + public partial interface IOperationStatusError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusError.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusError.TypeConverter.cs new file mode 100644 index 000000000000..0884e17b2ed6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusError.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationStatusErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationStatusError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationStatusError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationStatusError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusError.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusError.cs new file mode 100644 index 000000000000..1938dd73ad95 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IOperationStatusError, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/OperationStatusError.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusError.json.cs new file mode 100644 index 000000000000..710428d0e32e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusError.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IOperationStatusError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/OperationStatusExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..d44c9c0bbae6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusExtendedInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Base class for additional information of operation status. + [System.ComponentModel.TypeConverter(typeof(OperationStatusExtendedInfoTypeConverter))] + public partial class OperationStatusExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationStatusExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationStatusExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationStatusExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationStatusExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base class for additional information of operation status. + [System.ComponentModel.TypeConverter(typeof(OperationStatusExtendedInfoTypeConverter))] + public partial interface IOperationStatusExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..d1b5b267d1ec --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusExtendedInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationStatusExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationStatusExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationStatusExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationStatusExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusExtendedInfo.cs new file mode 100644 index 000000000000..89413b180f70 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IOperationStatusExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/OperationStatusExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusExtendedInfo.json.cs new file mode 100644 index 000000000000..06a37391b3a6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IOperationStatusExtendedInfo. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IOperationStatusExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 "OperationStatusRecoveryPointExtendedInfo": + { + return new OperationStatusRecoveryPointExtendedInfo(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.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..88570889da4b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobExtendedInfo.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Operation status job extended info. + [System.ComponentModel.TypeConverter(typeof(OperationStatusJobExtendedInfoTypeConverter))] + public partial class OperationStatusJobExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationStatusJobExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationStatusJobExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationStatusJobExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("JobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobExtendedInfoInternal)this).JobId = (string) content.GetValueForProperty("JobId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobExtendedInfoInternal)this).JobId, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationStatusJobExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("JobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobExtendedInfoInternal)this).JobId = (string) content.GetValueForProperty("JobId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobExtendedInfoInternal)this).JobId, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Operation status job extended info. + [System.ComponentModel.TypeConverter(typeof(OperationStatusJobExtendedInfoTypeConverter))] + public partial interface IOperationStatusJobExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..44b97a6a41f8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobExtendedInfo.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationStatusJobExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationStatusJobExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationStatusJobExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationStatusJobExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobExtendedInfo.cs new file mode 100644 index 000000000000..8a0f3938c438 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation status job extended info. + public partial class OperationStatusJobExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobExtendedInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfo __operationStatusExtendedInfo = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IOperationStatusExtendedInfoInternal)__operationStatusExtendedInfo).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobExtendedInfo.json.cs new file mode 100644 index 000000000000..754ab88eedad --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IOperationStatusJobExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..7c94ca1b4a6c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Operation status extended info for list of jobs. + [System.ComponentModel.TypeConverter(typeof(OperationStatusJobsExtendedInfoTypeConverter))] + public partial class OperationStatusJobsExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationStatusJobsExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationStatusJobsExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationStatusJobsExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("JobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoInternal)this).JobId = (string[]) content.GetValueForProperty("JobId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoInternal)this).JobId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FailedJobsError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoInternal)this).FailedJobsError = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoFailedJobsError) content.GetValueForProperty("FailedJobsError",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoInternal)this).FailedJobsError, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusJobsExtendedInfoFailedJobsErrorTypeConverter.ConvertFrom); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationStatusJobsExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("JobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoInternal)this).JobId = (string[]) content.GetValueForProperty("JobId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoInternal)this).JobId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FailedJobsError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoInternal)this).FailedJobsError = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoFailedJobsError) content.GetValueForProperty("FailedJobsError",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoInternal)this).FailedJobsError, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusJobsExtendedInfoFailedJobsErrorTypeConverter.ConvertFrom); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Operation status extended info for list of jobs. + [System.ComponentModel.TypeConverter(typeof(OperationStatusJobsExtendedInfoTypeConverter))] + public partial interface IOperationStatusJobsExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..26bfd90c3e51 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfo.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationStatusJobsExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationStatusJobsExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationStatusJobsExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationStatusJobsExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfo.cs new file mode 100644 index 000000000000..41632b1595e1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IOperationStatusJobsExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfo __operationStatusExtendedInfo = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusExtendedInfo(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IOperationStatusJobsExtendedInfoFailedJobsError FailedJobsError { get => (this._failedJobsError = this._failedJobsError ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IOperationStatusExtendedInfoInternal)__operationStatusExtendedInfo).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IOperationStatusJobsExtendedInfoFailedJobsError) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IOperationStatusExtendedInfoInternal + { + /// Stores all the failed jobs along with the corresponding error codes. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfo.json.cs new file mode 100644 index 000000000000..c73b9cb46662 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IOperationStatusJobsExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfoFailedJobsError.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfoFailedJobsError.PowerShell.cs new file mode 100644 index 000000000000..ee4634f253f6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfoFailedJobsError.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Stores all the failed jobs along with the corresponding error codes. + [System.ComponentModel.TypeConverter(typeof(OperationStatusJobsExtendedInfoFailedJobsErrorTypeConverter))] + public partial class OperationStatusJobsExtendedInfoFailedJobsError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoFailedJobsError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationStatusJobsExtendedInfoFailedJobsError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoFailedJobsError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationStatusJobsExtendedInfoFailedJobsError(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoFailedJobsError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationStatusJobsExtendedInfoFailedJobsError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationStatusJobsExtendedInfoFailedJobsError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Stores all the failed jobs along with the corresponding error codes. + [System.ComponentModel.TypeConverter(typeof(OperationStatusJobsExtendedInfoFailedJobsErrorTypeConverter))] + public partial interface IOperationStatusJobsExtendedInfoFailedJobsError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfoFailedJobsError.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfoFailedJobsError.TypeConverter.cs new file mode 100644 index 000000000000..a3428ad3766d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfoFailedJobsError.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationStatusJobsExtendedInfoFailedJobsErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoFailedJobsError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoFailedJobsError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationStatusJobsExtendedInfoFailedJobsError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationStatusJobsExtendedInfoFailedJobsError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationStatusJobsExtendedInfoFailedJobsError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfoFailedJobsError.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfoFailedJobsError.cs new file mode 100644 index 000000000000..3dc8b22aa2f7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IOperationStatusJobsExtendedInfoFailedJobsError, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfoFailedJobsError.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfoFailedJobsError.dictionary.cs new file mode 100644 index 000000000000..ddf3a7afd51a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.OperationStatusJobsExtendedInfoFailedJobsError source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfoFailedJobsError.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfoFailedJobsError.json.cs new file mode 100644 index 000000000000..71d3f9c50114 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusJobsExtendedInfoFailedJobsError.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IOperationStatusJobsExtendedInfoFailedJobsError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusJobsExtendedInfoFailedJobsError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/OperationStatusProvisionIlrExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusProvisionIlrExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..418493797cfb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusProvisionIlrExtendedInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Operation status extended info for ILR provision action. + [System.ComponentModel.TypeConverter(typeof(OperationStatusProvisionIlrExtendedInfoTypeConverter))] + public partial class OperationStatusProvisionIlrExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationStatusProvisionIlrExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationStatusProvisionIlrExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationStatusProvisionIlrExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RecoveryTarget")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfoInternal)this).RecoveryTarget = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTarget) content.GetValueForProperty("RecoveryTarget",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfoInternal)this).RecoveryTarget, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.InstantItemRecoveryTargetTypeConverter.ConvertFrom); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryTargetClientScript")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfoInternal)this).RecoveryTargetClientScript = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnect[]) content.GetValueForProperty("RecoveryTargetClientScript",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfoInternal)this).RecoveryTargetClientScript, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ClientScriptForConnectTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationStatusProvisionIlrExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RecoveryTarget")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfoInternal)this).RecoveryTarget = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTarget) content.GetValueForProperty("RecoveryTarget",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfoInternal)this).RecoveryTarget, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.InstantItemRecoveryTargetTypeConverter.ConvertFrom); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("RecoveryTargetClientScript")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfoInternal)this).RecoveryTargetClientScript = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnect[]) content.GetValueForProperty("RecoveryTargetClientScript",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfoInternal)this).RecoveryTargetClientScript, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ClientScriptForConnectTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Operation status extended info for ILR provision action. + [System.ComponentModel.TypeConverter(typeof(OperationStatusProvisionIlrExtendedInfoTypeConverter))] + public partial interface IOperationStatusProvisionIlrExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusProvisionIlrExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusProvisionIlrExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..120e37f32171 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusProvisionIlrExtendedInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationStatusProvisionIlrExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationStatusProvisionIlrExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationStatusProvisionIlrExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationStatusProvisionIlrExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusProvisionIlrExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusProvisionIlrExtendedInfo.cs new file mode 100644 index 000000000000..15d10dfa2814 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IOperationStatusProvisionIlrExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfo __operationStatusExtendedInfo = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusExtendedInfo(); + + /// Internal Acessors for RecoveryTarget + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTarget Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfoInternal.RecoveryTarget { get => (this._recoveryTarget = this._recoveryTarget ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IOperationStatusExtendedInfoInternal)__operationStatusExtendedInfo).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)__operationStatusExtendedInfo).ObjectType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IInstantItemRecoveryTarget RecoveryTarget { get => (this._recoveryTarget = this._recoveryTarget ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IClientScriptForConnect[] RecoveryTargetClientScript { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTargetInternal)RecoveryTarget).ClientScript; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IClientScriptForConnect) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnect[] RecoveryTargetClientScript { get; set; } + + } + /// Operation status extended info for ILR provision action. + internal partial interface IOperationStatusProvisionIlrExtendedInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal + { + /// Target details for file / folder restore. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IInstantItemRecoveryTarget RecoveryTarget { get; set; } + /// List of client scripts. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IClientScriptForConnect[] RecoveryTargetClientScript { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusProvisionIlrExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusProvisionIlrExtendedInfo.json.cs new file mode 100644 index 000000000000..11b1135deffe --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusProvisionIlrExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IOperationStatusProvisionIlrExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusProvisionIlrExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.OperationStatusExtendedInfo(json); + {_recoveryTarget = If( json?.PropertyT("recoveryTarget"), out var __jsonRecoveryTarget) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/OperationStatusRecoveryPointExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusRecoveryPointExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..db263addc36e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusRecoveryPointExtendedInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Operation status extended info for Updated Recovery Point. + [System.ComponentModel.TypeConverter(typeof(OperationStatusRecoveryPointExtendedInfoTypeConverter))] + public partial class OperationStatusRecoveryPointExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationStatusRecoveryPointExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationStatusRecoveryPointExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationStatusRecoveryPointExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UpdatedRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfoInternal)this).UpdatedRecoveryPoint = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint) content.GetValueForProperty("UpdatedRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfoInternal)this).UpdatedRecoveryPoint, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTypeConverter.ConvertFrom); + } + if (content.Contains("DeletedBackupItemVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfoInternal)this).DeletedBackupItemVersion = (string) content.GetValueForProperty("DeletedBackupItemVersion",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfoInternal)this).DeletedBackupItemVersion, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("UpdatedRecoveryPointObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfoInternal)this).UpdatedRecoveryPointObjectType = (string) content.GetValueForProperty("UpdatedRecoveryPointObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfoInternal)this).UpdatedRecoveryPointObjectType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationStatusRecoveryPointExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UpdatedRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfoInternal)this).UpdatedRecoveryPoint = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint) content.GetValueForProperty("UpdatedRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfoInternal)this).UpdatedRecoveryPoint, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTypeConverter.ConvertFrom); + } + if (content.Contains("DeletedBackupItemVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfoInternal)this).DeletedBackupItemVersion = (string) content.GetValueForProperty("DeletedBackupItemVersion",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfoInternal)this).DeletedBackupItemVersion, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("UpdatedRecoveryPointObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfoInternal)this).UpdatedRecoveryPointObjectType = (string) content.GetValueForProperty("UpdatedRecoveryPointObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfoInternal)this).UpdatedRecoveryPointObjectType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Operation status extended info for Updated Recovery Point. + [System.ComponentModel.TypeConverter(typeof(OperationStatusRecoveryPointExtendedInfoTypeConverter))] + public partial interface IOperationStatusRecoveryPointExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusRecoveryPointExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusRecoveryPointExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..3cded78d57d7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusRecoveryPointExtendedInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationStatusRecoveryPointExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationStatusRecoveryPointExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationStatusRecoveryPointExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationStatusRecoveryPointExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusRecoveryPointExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusRecoveryPointExtendedInfo.cs new file mode 100644 index 000000000000..5e05fdcb76b2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusRecoveryPointExtendedInfo.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation status extended info for Updated Recovery Point. + public partial class OperationStatusRecoveryPointExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfo __operationStatusExtendedInfo = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.OperationStatusExtendedInfo(); + + /// Backing field for property. + private string _deletedBackupItemVersion; + + /// + /// In case the share is in soft-deleted state, populate this field with deleted backup item + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string DeletedBackupItemVersion { get => this._deletedBackupItemVersion; set => this._deletedBackupItemVersion = value; } + + /// Internal Acessors for UpdatedRecoveryPoint + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfoInternal.UpdatedRecoveryPoint { get => (this._updatedRecoveryPoint = this._updatedRecoveryPoint ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPoint()); set { {_updatedRecoveryPoint = 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.Api20241115.IOperationStatusExtendedInfoInternal)__operationStatusExtendedInfo).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal)__operationStatusExtendedInfo).ObjectType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint _updatedRecoveryPoint; + + /// Recovery Point info with updated source snapshot URI + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint UpdatedRecoveryPoint { get => (this._updatedRecoveryPoint = this._updatedRecoveryPoint ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPoint()); set => this._updatedRecoveryPoint = 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 UpdatedRecoveryPointObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)UpdatedRecoveryPoint).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)UpdatedRecoveryPoint).ObjectType = value ?? null; } + + /// + /// Creates an new instance. + /// + public OperationStatusRecoveryPointExtendedInfo() + { + + } + + /// 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 Updated Recovery Point. + public partial interface IOperationStatusRecoveryPointExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfo + { + /// + /// In case the share is in soft-deleted state, populate this field with deleted backup item + /// + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"In case the share is in soft-deleted state, populate this field with deleted backup item", + SerializedName = @"deletedBackupItemVersion", + PossibleTypes = new [] { typeof(string) })] + string DeletedBackupItemVersion { 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 UpdatedRecoveryPointObjectType { get; set; } + + } + /// Operation status extended info for Updated Recovery Point. + internal partial interface IOperationStatusRecoveryPointExtendedInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusExtendedInfoInternal + { + /// + /// In case the share is in soft-deleted state, populate this field with deleted backup item + /// + string DeletedBackupItemVersion { get; set; } + /// Recovery Point info with updated source snapshot URI + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint UpdatedRecoveryPoint { get; set; } + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + string UpdatedRecoveryPointObjectType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusRecoveryPointExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusRecoveryPointExtendedInfo.json.cs new file mode 100644 index 000000000000..64bf76df249f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/OperationStatusRecoveryPointExtendedInfo.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Operation status extended info for Updated Recovery Point. + public partial class OperationStatusRecoveryPointExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IOperationStatusRecoveryPointExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatusRecoveryPointExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new OperationStatusRecoveryPointExtendedInfo(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 OperationStatusRecoveryPointExtendedInfo(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.Api20241115.OperationStatusExtendedInfo(json); + {_updatedRecoveryPoint = If( json?.PropertyT("updatedRecoveryPoint"), out var __jsonUpdatedRecoveryPoint) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPoint.FromJson(__jsonUpdatedRecoveryPoint) : UpdatedRecoveryPoint;} + {_deletedBackupItemVersion = If( json?.PropertyT("deletedBackupItemVersion"), out var __jsonDeletedBackupItemVersion) ? (string)__jsonDeletedBackupItemVersion : (string)DeletedBackupItemVersion;} + 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._updatedRecoveryPoint ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) this._updatedRecoveryPoint.ToJson(null,serializationMode) : null, "updatedRecoveryPoint" ,container.Add ); + AddIf( null != (((object)this._deletedBackupItemVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._deletedBackupItemVersion.ToString()) : null, "deletedBackupItemVersion" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/PointInTimeRange.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/PointInTimeRange.PowerShell.cs new file mode 100644 index 000000000000..c36cba211fc3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/PointInTimeRange.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Provides details for log ranges + [System.ComponentModel.TypeConverter(typeof(PointInTimeRangeTypeConverter))] + public partial class PointInTimeRange + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PointInTimeRange(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PointInTimeRange(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PointInTimeRange(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRangeInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRangeInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRangeInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRangeInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PointInTimeRange(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRangeInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRangeInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRangeInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRangeInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Provides details for log ranges + [System.ComponentModel.TypeConverter(typeof(PointInTimeRangeTypeConverter))] + public partial interface IPointInTimeRange + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/PointInTimeRange.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/PointInTimeRange.TypeConverter.cs new file mode 100644 index 000000000000..8e885f30e2cd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/PointInTimeRange.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PointInTimeRangeTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PointInTimeRange.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PointInTimeRange.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PointInTimeRange.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/PointInTimeRange.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/PointInTimeRange.cs new file mode 100644 index 000000000000..181e12ff5e7e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Provides details for log ranges + public partial class PointInTimeRange : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/PointInTimeRange.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/PointInTimeRange.json.cs new file mode 100644 index 000000000000..2da3457f1baa --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/PointInTimeRange.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IPointInTimeRange. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IPointInTimeRange. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/ProtectedItem.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItem.PowerShell.cs new file mode 100644 index 000000000000..7b1d730c0566 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItem.PowerShell.cs @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Base class for backup items. + [System.ComponentModel.TypeConverter(typeof(ProtectedItemTypeConverter))] + public partial class ProtectedItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProtectedItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProtectedItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProtectedItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProtectedItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base class for backup items. + [System.ComponentModel.TypeConverter(typeof(ProtectedItemTypeConverter))] + public partial interface IProtectedItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItem.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItem.TypeConverter.cs new file mode 100644 index 000000000000..e919db72edef --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItem.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProtectedItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProtectedItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProtectedItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProtectedItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItem.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItem.cs new file mode 100644 index 000000000000..1d9d682be435 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItem.cs @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for backup items. + public partial class ProtectedItem : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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? _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[] _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 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; } + /// 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 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; } + /// 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.DefaultTag/generated/api/Models/Api20241115/ProtectedItem.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItem.json.cs new file mode 100644 index 000000000000..a8244c9d6ea9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItem.json.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IProtectedItem. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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;} + 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); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemQueryObject.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemQueryObject.PowerShell.cs new file mode 100644 index 000000000000..ba3d3eabf305 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemQueryObject.PowerShell.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Filters to list backup items. + [System.ComponentModel.TypeConverter(typeof(ProtectedItemQueryObjectTypeConverter))] + public partial class ProtectedItemQueryObject + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObject DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProtectedItemQueryObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObject DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProtectedItemQueryObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObject FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProtectedItemQueryObject(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("HealthState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).HealthState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState?) content.GetValueForProperty("HealthState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).HealthState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState.CreateFrom); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("ItemType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).ItemType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("ItemType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).ItemType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("PolicyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).PolicyName = (string) content.GetValueForProperty("PolicyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).PolicyName, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("BackupEngineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).BackupEngineName = (string) content.GetValueForProperty("BackupEngineName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).BackupEngineName, global::System.Convert.ToString); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("FabricName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).FabricName = (string) content.GetValueForProperty("FabricName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).FabricName, global::System.Convert.ToString); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).BackupSetName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProtectedItemQueryObject(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("HealthState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).HealthState = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState?) content.GetValueForProperty("HealthState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).HealthState, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthState.CreateFrom); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("ItemType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).ItemType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("ItemType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).ItemType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("PolicyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).PolicyName = (string) content.GetValueForProperty("PolicyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).PolicyName, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("BackupEngineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).BackupEngineName = (string) content.GetValueForProperty("BackupEngineName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).BackupEngineName, global::System.Convert.ToString); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("FabricName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).FabricName = (string) content.GetValueForProperty("FabricName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).FabricName, global::System.Convert.ToString); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObjectInternal)this).BackupSetName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Filters to list backup items. + [System.ComponentModel.TypeConverter(typeof(ProtectedItemQueryObjectTypeConverter))] + public partial interface IProtectedItemQueryObject + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemQueryObject.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemQueryObject.TypeConverter.cs new file mode 100644 index 000000000000..b24cf217bf22 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemQueryObject.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProtectedItemQueryObjectTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObject ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObject).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProtectedItemQueryObject.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProtectedItemQueryObject.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProtectedItemQueryObject.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemQueryObject.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemQueryObject.cs new file mode 100644 index 000000000000..39f6bc1760d0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Filters to list backup items. + public partial class ProtectedItemQueryObject : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObject, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/ProtectedItemQueryObject.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemQueryObject.json.cs new file mode 100644 index 000000000000..51e911994533 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemQueryObject.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IProtectedItemQueryObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemQueryObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResource.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResource.PowerShell.cs new file mode 100644 index 000000000000..dd03978f7986 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResource.PowerShell.cs @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Base class for backup items. + [System.ComponentModel.TypeConverter(typeof(ProtectedItemResourceTypeConverter))] + public partial class ProtectedItemResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProtectedItemResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProtectedItemResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProtectedItemResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ProtectedItemTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("ProtectedItemType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).ProtectedItemType = (string) content.GetValueForProperty("ProtectedItemType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).ProtectedItemType, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProtectedItemResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ProtectedItemTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("CreateMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).CreateMode = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode?) content.GetValueForProperty("CreateMode",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).CreateMode, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateMode.CreateFrom); + } + if (content.Contains("ProtectedItemType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).ProtectedItemType = (string) content.GetValueForProperty("ProtectedItemType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).ProtectedItemType, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).BackupManagementType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType?) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).BackupManagementType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementType.CreateFrom); + } + if (content.Contains("WorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).WorkloadType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType?) content.GetValueForProperty("WorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).WorkloadType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceType.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("LastRecoveryPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).LastRecoveryPoint = (global::System.DateTime?) content.GetValueForProperty("LastRecoveryPoint",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).LastRecoveryPoint, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BackupSetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).BackupSetName = (string) content.GetValueForProperty("BackupSetName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).BackupSetName, global::System.Convert.ToString); + } + if (content.Contains("DeferredDeleteTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).DeferredDeleteTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("DeferredDeleteTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).DeferredDeleteTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IsScheduledForDeferredDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).IsScheduledForDeferredDelete = (bool?) content.GetValueForProperty("IsScheduledForDeferredDelete",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).IsScheduledForDeferredDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeferredDeleteTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).DeferredDeleteTimeRemaining = (string) content.GetValueForProperty("DeferredDeleteTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).DeferredDeleteTimeRemaining, global::System.Convert.ToString); + } + if (content.Contains("IsDeferredDeleteScheduleUpcoming")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).IsDeferredDeleteScheduleUpcoming = (bool?) content.GetValueForProperty("IsDeferredDeleteScheduleUpcoming",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).IsDeferredDeleteScheduleUpcoming, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsRehydrate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).IsRehydrate = (bool?) content.GetValueForProperty("IsRehydrate",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).IsRehydrate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ResourceGuardOperationRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).ResourceGuardOperationRequest = (string[]) content.GetValueForProperty("ResourceGuardOperationRequest",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal)this).ResourceGuardOperationRequest, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base class for backup items. + [System.ComponentModel.TypeConverter(typeof(ProtectedItemResourceTypeConverter))] + public partial interface IProtectedItemResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResource.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResource.TypeConverter.cs new file mode 100644 index 000000000000..2f50f088da00 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResource.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProtectedItemResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProtectedItemResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProtectedItemResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProtectedItemResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResource.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResource.cs new file mode 100644 index 000000000000..213ae310ca46 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResource.cs @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Base class for backup items. + public partial class ProtectedItemResource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)Property).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)Property).BackupSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)Property).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)Property).CreateMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)Property).DeferredDeleteTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)Property).DeferredDeleteTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).Id; } + + /// 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.Api20241115.IProtectedItemInternal)Property).IsDeferredDeleteScheduleUpcoming; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)Property).IsRehydrate; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)Property).IsScheduledForDeferredDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)Property).LastRecoveryPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ProtectedItem()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IProtectedItemInternal)Property).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemInternal)Property).PolicyId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem _property; + + /// ProtectedItemResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItem Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)Property).ResourceGuardOperationRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IProtectedItemInternal)Property).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IProtectedItemInternal)Property).WorkloadType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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 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; } + /// 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.Api20241115.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 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; } + /// ProtectedItemResource properties + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResource.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResource.json.cs new file mode 100644 index 000000000000..4795d883e5ac --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResource.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IProtectedItemResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResourceList.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResourceList.PowerShell.cs new file mode 100644 index 000000000000..27d33b37207c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResourceList.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// List of ProtectedItem resources + [System.ComponentModel.TypeConverter(typeof(ProtectedItemResourceListTypeConverter))] + public partial class ProtectedItemResourceList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProtectedItemResourceList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProtectedItemResourceList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProtectedItemResourceList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ProtectedItemResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProtectedItemResourceList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ProtectedItemResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// List of ProtectedItem resources + [System.ComponentModel.TypeConverter(typeof(ProtectedItemResourceListTypeConverter))] + public partial interface IProtectedItemResourceList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResourceList.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResourceList.TypeConverter.cs new file mode 100644 index 000000000000..37fb470ad397 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResourceList.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProtectedItemResourceListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProtectedItemResourceList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProtectedItemResourceList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProtectedItemResourceList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResourceList.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResourceList.cs new file mode 100644 index 000000000000..c0d186816bc4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of ProtectedItem resources + public partial class ProtectedItemResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceListInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceList __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceListInternal)__resourceList).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)__resourceList).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.IProtectedItemResource) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource[] Value { get; set; } + + } + /// List of ProtectedItem resources + internal partial interface IProtectedItemResourceListInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal + { + /// List of resources. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResourceList.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResourceList.json.cs new file mode 100644 index 000000000000..828f65c7a543 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ProtectedItemResourceList.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IProtectedItemResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IProtectedItemResource) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RecoveryPoint.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPoint.PowerShell.cs new file mode 100644 index 000000000000..544babfaceb2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPoint.PowerShell.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// Base class for backup copies. Workload-specific backup copies are derived from this class. + /// + [System.ComponentModel.TypeConverter(typeof(RecoveryPointTypeConverter))] + public partial class RecoveryPoint + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RecoveryPoint(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RecoveryPoint(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RecoveryPoint(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RecoveryPoint(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)this).ObjectType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base class for backup copies. Workload-specific backup copies are derived from this class. + [System.ComponentModel.TypeConverter(typeof(RecoveryPointTypeConverter))] + public partial interface IRecoveryPoint + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPoint.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPoint.TypeConverter.cs new file mode 100644 index 000000000000..db77a5cf406a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPoint.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RecoveryPointTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RecoveryPoint.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RecoveryPoint.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RecoveryPoint.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPoint.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPoint.cs new file mode 100644 index 000000000000..8ed3b82c2eb8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IRecoveryPoint, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RecoveryPoint.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPoint.json.cs new file mode 100644 index 000000000000..8df8b98ef06b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPoint.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IRecoveryPoint. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRecoveryPoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RecoveryPointDiskConfiguration.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointDiskConfiguration.PowerShell.cs new file mode 100644 index 000000000000..05c8ab2456ff --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointDiskConfiguration.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Disk configuration + [System.ComponentModel.TypeConverter(typeof(RecoveryPointDiskConfigurationTypeConverter))] + public partial class RecoveryPointDiskConfiguration + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RecoveryPointDiskConfiguration(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RecoveryPointDiskConfiguration(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RecoveryPointDiskConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NumberOfDisksIncludedInBackup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).NumberOfDisksIncludedInBackup = (int?) content.GetValueForProperty("NumberOfDisksIncludedInBackup",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).NumberOfDisksIncludedInBackup, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NumberOfDisksAttachedToVM")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).NumberOfDisksAttachedToVM = (int?) content.GetValueForProperty("NumberOfDisksAttachedToVM",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).NumberOfDisksAttachedToVM, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IncludedDiskList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).IncludedDiskList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation[]) content.GetValueForProperty("IncludedDiskList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).IncludedDiskList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("ExcludedDiskList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).ExcludedDiskList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation[]) content.GetValueForProperty("ExcludedDiskList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).ExcludedDiskList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskInformationTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RecoveryPointDiskConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NumberOfDisksIncludedInBackup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).NumberOfDisksIncludedInBackup = (int?) content.GetValueForProperty("NumberOfDisksIncludedInBackup",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).NumberOfDisksIncludedInBackup, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NumberOfDisksAttachedToVM")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).NumberOfDisksAttachedToVM = (int?) content.GetValueForProperty("NumberOfDisksAttachedToVM",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).NumberOfDisksAttachedToVM, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IncludedDiskList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).IncludedDiskList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation[]) content.GetValueForProperty("IncludedDiskList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).IncludedDiskList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskInformationTypeConverter.ConvertFrom)); + } + if (content.Contains("ExcludedDiskList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).ExcludedDiskList = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IDiskInformation[]) content.GetValueForProperty("ExcludedDiskList",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal)this).ExcludedDiskList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.DiskInformationTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Disk configuration + [System.ComponentModel.TypeConverter(typeof(RecoveryPointDiskConfigurationTypeConverter))] + public partial interface IRecoveryPointDiskConfiguration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointDiskConfiguration.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointDiskConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..37a544e62fc9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointDiskConfiguration.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RecoveryPointDiskConfigurationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RecoveryPointDiskConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RecoveryPointDiskConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RecoveryPointDiskConfiguration.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointDiskConfiguration.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointDiskConfiguration.cs new file mode 100644 index 000000000000..e83546850338 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Disk configuration + public partial class RecoveryPointDiskConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDiskInformation[] ExcludedDiskList { get => this._excludedDiskList; set => this._excludedDiskList = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IDiskInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDiskInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDiskInformation[] ExcludedDiskList { get; set; } + /// Information of disks included in backup + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RecoveryPointDiskConfiguration.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointDiskConfiguration.json.cs new file mode 100644 index 000000000000..913bad7b8c9f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointDiskConfiguration.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IRecoveryPointDiskConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointDiskConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDiskInformation) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IDiskInformation) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RecoveryPointMoveReadinessInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointMoveReadinessInfo.PowerShell.cs new file mode 100644 index 000000000000..ecba2a075819 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointMoveReadinessInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(RecoveryPointMoveReadinessInfoTypeConverter))] + public partial class RecoveryPointMoveReadinessInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointMoveReadinessInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RecoveryPointMoveReadinessInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointMoveReadinessInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RecoveryPointMoveReadinessInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointMoveReadinessInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RecoveryPointMoveReadinessInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IsReadyForMove")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointMoveReadinessInfoInternal)this).IsReadyForMove = (bool?) content.GetValueForProperty("IsReadyForMove",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointMoveReadinessInfoInternal)this).IsReadyForMove, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointMoveReadinessInfoInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointMoveReadinessInfoInternal)this).AdditionalInfo, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RecoveryPointMoveReadinessInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IsReadyForMove")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointMoveReadinessInfoInternal)this).IsReadyForMove = (bool?) content.GetValueForProperty("IsReadyForMove",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointMoveReadinessInfoInternal)this).IsReadyForMove, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointMoveReadinessInfoInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointMoveReadinessInfoInternal)this).AdditionalInfo, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(RecoveryPointMoveReadinessInfoTypeConverter))] + public partial interface IRecoveryPointMoveReadinessInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointMoveReadinessInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointMoveReadinessInfo.TypeConverter.cs new file mode 100644 index 000000000000..23b4504d054c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointMoveReadinessInfo.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RecoveryPointMoveReadinessInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointMoveReadinessInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointMoveReadinessInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RecoveryPointMoveReadinessInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RecoveryPointMoveReadinessInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RecoveryPointMoveReadinessInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointMoveReadinessInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointMoveReadinessInfo.cs new file mode 100644 index 000000000000..d6098d33586c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class RecoveryPointMoveReadinessInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointMoveReadinessInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RecoveryPointMoveReadinessInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointMoveReadinessInfo.json.cs new file mode 100644 index 000000000000..d2e46fc3f1b2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointMoveReadinessInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IRecoveryPointMoveReadinessInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointMoveReadinessInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RecoveryPointProperties.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointProperties.PowerShell.cs new file mode 100644 index 000000000000..dc3dc6466b53 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointProperties.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Properties of Recovery Point + [System.ComponentModel.TypeConverter(typeof(RecoveryPointPropertiesTypeConverter))] + public partial class RecoveryPointProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RecoveryPointProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RecoveryPointProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RecoveryPointProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)this).ExpiryTime = (string) content.GetValueForProperty("ExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)this).ExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)this).RuleName = (string) content.GetValueForProperty("RuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)this).RuleName, global::System.Convert.ToString); + } + if (content.Contains("IsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)this).IsSoftDeleted = (bool?) content.GetValueForProperty("IsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)this).IsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RecoveryPointProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)this).ExpiryTime = (string) content.GetValueForProperty("ExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)this).ExpiryTime, global::System.Convert.ToString); + } + if (content.Contains("RuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)this).RuleName = (string) content.GetValueForProperty("RuleName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)this).RuleName, global::System.Convert.ToString); + } + if (content.Contains("IsSoftDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)this).IsSoftDeleted = (bool?) content.GetValueForProperty("IsSoftDeleted",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal)this).IsSoftDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of Recovery Point + [System.ComponentModel.TypeConverter(typeof(RecoveryPointPropertiesTypeConverter))] + public partial interface IRecoveryPointProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointProperties.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointProperties.TypeConverter.cs new file mode 100644 index 000000000000..28e456a532b4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointProperties.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RecoveryPointPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RecoveryPointProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RecoveryPointProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RecoveryPointProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointProperties.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointProperties.cs new file mode 100644 index 000000000000..e1ac465cc790 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointProperties.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Properties of Recovery Point + public partial class RecoveryPointProperties : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointPropertiesInternal + { + + /// Backing field for property. + private string _expiryTime; + + /// Expiry time of Recovery Point in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ExpiryTime { get => this._expiryTime; set => this._expiryTime = value; } + + /// Backing field for property. + private bool? _isSoftDeleted; + + /// Bool to indicate whether RP is in soft delete state or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public bool? IsSoftDeleted { get => this._isSoftDeleted; set => this._isSoftDeleted = value; } + + /// Backing field for property. + private string _ruleName; + + /// Rule name tagged on Recovery Point that governs life cycle + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string RuleName { get => this._ruleName; set => this._ruleName = value; } + + /// Creates an new instance. + public RecoveryPointProperties() + { + + } + } + /// Properties of Recovery Point + public partial interface IRecoveryPointProperties : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable + { + /// Expiry time of Recovery Point in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiry time of Recovery Point in UTC.", + SerializedName = @"expiryTime", + PossibleTypes = new [] { typeof(string) })] + string ExpiryTime { get; set; } + /// Bool to indicate whether RP is in soft delete state or not + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Bool to indicate whether RP is in soft delete state or not", + SerializedName = @"isSoftDeleted", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSoftDeleted { get; set; } + /// Rule name tagged on Recovery Point that governs life cycle + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rule name tagged on Recovery Point that governs life cycle", + SerializedName = @"ruleName", + PossibleTypes = new [] { typeof(string) })] + string RuleName { get; set; } + + } + /// Properties of Recovery Point + internal partial interface IRecoveryPointPropertiesInternal + + { + /// Expiry time of Recovery Point in UTC. + string ExpiryTime { get; set; } + /// Bool to indicate whether RP is in soft delete state or not + bool? IsSoftDeleted { get; set; } + /// Rule name tagged on Recovery Point that governs life cycle + string RuleName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointProperties.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointProperties.json.cs new file mode 100644 index 000000000000..9ce7bfa06b20 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointProperties.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Properties of Recovery Point + public partial class RecoveryPointProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IRecoveryPointProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new RecoveryPointProperties(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 RecoveryPointProperties(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_expiryTime = If( json?.PropertyT("expiryTime"), out var __jsonExpiryTime) ? (string)__jsonExpiryTime : (string)ExpiryTime;} + {_ruleName = If( json?.PropertyT("ruleName"), out var __jsonRuleName) ? (string)__jsonRuleName : (string)RuleName;} + {_isSoftDeleted = If( json?.PropertyT("isSoftDeleted"), out var __jsonIsSoftDeleted) ? (bool?)__jsonIsSoftDeleted : IsSoftDeleted;} + 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._expiryTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._expiryTime.ToString()) : null, "expiryTime" ,container.Add ); + AddIf( null != (((object)this._ruleName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._ruleName.ToString()) : null, "ruleName" ,container.Add ); + AddIf( null != this._isSoftDeleted ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonBoolean((bool)this._isSoftDeleted) : null, "isSoftDeleted" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResource.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResource.PowerShell.cs new file mode 100644 index 000000000000..67a04477d861 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResource.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// Base class for backup copies. Workload-specific backup copies are derived from this class. + /// + [System.ComponentModel.TypeConverter(typeof(RecoveryPointResourceTypeConverter))] + public partial class RecoveryPointResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RecoveryPointResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RecoveryPointResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RecoveryPointResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceInternal)this).ObjectType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RecoveryPointResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceInternal)this).ObjectType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base class for backup copies. Workload-specific backup copies are derived from this class. + [System.ComponentModel.TypeConverter(typeof(RecoveryPointResourceTypeConverter))] + public partial interface IRecoveryPointResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResource.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResource.TypeConverter.cs new file mode 100644 index 000000000000..1ee5f79f79dd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResource.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RecoveryPointResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RecoveryPointResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RecoveryPointResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RecoveryPointResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResource.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResource.cs new file mode 100644 index 000000000000..3b53910cbad7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IRecoveryPointResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Location = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPoint()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IRecoveryPointInternal)Property).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointInternal)Property).ObjectType = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint _property; + + /// RecoveryPointResource properties + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPoint Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.IRecoveryPoint Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResource.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResource.json.cs new file mode 100644 index 000000000000..5d7c5bdd52c3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResource.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IRecoveryPointResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResourceList.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResourceList.PowerShell.cs new file mode 100644 index 000000000000..0ca70b48ab24 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResourceList.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// List of RecoveryPoint resources + [System.ComponentModel.TypeConverter(typeof(RecoveryPointResourceListTypeConverter))] + public partial class RecoveryPointResourceList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RecoveryPointResourceList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RecoveryPointResourceList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RecoveryPointResourceList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RecoveryPointResourceList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// List of RecoveryPoint resources + [System.ComponentModel.TypeConverter(typeof(RecoveryPointResourceListTypeConverter))] + public partial interface IRecoveryPointResourceList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResourceList.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResourceList.TypeConverter.cs new file mode 100644 index 000000000000..00bbfdb0923e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResourceList.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RecoveryPointResourceListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RecoveryPointResourceList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RecoveryPointResourceList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RecoveryPointResourceList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResourceList.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResourceList.cs new file mode 100644 index 000000000000..c86cbac06fa2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// List of RecoveryPoint resources + public partial class RecoveryPointResourceList : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceListInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceList __resourceList = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceListInternal)__resourceList).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)__resourceList).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.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.Api20241115.IRecoveryPointResource) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource[] Value { get; set; } + + } + /// List of RecoveryPoint resources + internal partial interface IRecoveryPointResourceListInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal + { + /// List of resources. + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResourceList.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResourceList.json.cs new file mode 100644 index 000000000000..84b62f33035a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointResourceList.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IRecoveryPointResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.Api20241115.IRecoveryPointResource) (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformation.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformation.PowerShell.cs new file mode 100644 index 000000000000..aea571c77c2c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformation.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Recovery point tier information. + [System.ComponentModel.TypeConverter(typeof(RecoveryPointTierInformationTypeConverter))] + public partial class RecoveryPointTierInformation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RecoveryPointTierInformation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RecoveryPointTierInformation(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RecoveryPointTierInformation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType.CreateFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus.CreateFrom); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationExtendedInfoTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RecoveryPointTierInformation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierType.CreateFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatus.CreateFrom); + } + if (content.Contains("ExtendedInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationInternal)this).ExtendedInfo = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationExtendedInfo) content.GetValueForProperty("ExtendedInfo",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationInternal)this).ExtendedInfo, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.RecoveryPointTierInformationExtendedInfoTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Recovery point tier information. + [System.ComponentModel.TypeConverter(typeof(RecoveryPointTierInformationTypeConverter))] + public partial interface IRecoveryPointTierInformation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformation.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformation.TypeConverter.cs new file mode 100644 index 000000000000..dadd8712b1fa --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformation.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RecoveryPointTierInformationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RecoveryPointTierInformation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RecoveryPointTierInformation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RecoveryPointTierInformation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformation.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformation.cs new file mode 100644 index 000000000000..3a5420d081dd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point tier information. + public partial class RecoveryPointTierInformation : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRecoveryPointTierInformationExtendedInfo ExtendedInfo { get => (this._extendedInfo = this._extendedInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRecoveryPointTierInformationExtendedInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformation.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformation.json.cs new file mode 100644 index 000000000000..c13b22f7f39e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformation.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IRecoveryPointTierInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformationExtendedInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformationExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..f42abe1a95b7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformationExtendedInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Recovery point tier status. + [System.ComponentModel.TypeConverter(typeof(RecoveryPointTierInformationExtendedInfoTypeConverter))] + public partial class RecoveryPointTierInformationExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RecoveryPointTierInformationExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RecoveryPointTierInformationExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RecoveryPointTierInformationExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RecoveryPointTierInformationExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Recovery point tier status. + [System.ComponentModel.TypeConverter(typeof(RecoveryPointTierInformationExtendedInfoTypeConverter))] + public partial interface IRecoveryPointTierInformationExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformationExtendedInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformationExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..1f503d6293a9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformationExtendedInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RecoveryPointTierInformationExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RecoveryPointTierInformationExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RecoveryPointTierInformationExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RecoveryPointTierInformationExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformationExtendedInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformationExtendedInfo.cs new file mode 100644 index 000000000000..c7c248d106bd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Recovery point tier status. + public partial class RecoveryPointTierInformationExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformationExtendedInfo.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformationExtendedInfo.dictionary.cs new file mode 100644 index 000000000000..0f9ba614981a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.RecoveryPointTierInformationExtendedInfo source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformationExtendedInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformationExtendedInfo.json.cs new file mode 100644 index 000000000000..8bbb8ceeae82 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RecoveryPointTierInformationExtendedInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IRecoveryPointTierInformationExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointTierInformationExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/Resource.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Resource.PowerShell.cs new file mode 100644 index 000000000000..8b0fd58f25e1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Resource.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// ARM Resource. + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial class Resource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Resource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Resource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Resource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Resource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// ARM Resource. + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial interface IResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Resource.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Resource.TypeConverter.cs new file mode 100644 index 000000000000..c60362cf0c46 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Resource.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Resource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Resource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Resource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Resource.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Resource.cs new file mode 100644 index 000000000000..d5937acfc9af --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// ARM Resource. + public partial class Resource : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceTags _tag; + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/Resource.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Resource.json.cs new file mode 100644 index 000000000000..0fb9809868a8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/Resource.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/ResourceHealthDetails.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceHealthDetails.PowerShell.cs new file mode 100644 index 000000000000..30f9cf6957df --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceHealthDetails.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Health Details for backup items. + [System.ComponentModel.TypeConverter(typeof(ResourceHealthDetailsTypeConverter))] + public partial class ResourceHealthDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceHealthDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceHealthDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceHealthDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Code = (int?) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Code, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Title")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Title, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceHealthDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Code = (int?) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Code, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Title")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Title, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Health Details for backup items. + [System.ComponentModel.TypeConverter(typeof(ResourceHealthDetailsTypeConverter))] + public partial interface IResourceHealthDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceHealthDetails.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceHealthDetails.TypeConverter.cs new file mode 100644 index 000000000000..57aca11da222 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceHealthDetails.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceHealthDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceHealthDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceHealthDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceHealthDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceHealthDetails.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceHealthDetails.cs new file mode 100644 index 000000000000..f93ca725a74e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Health Details for backup items. + public partial class ResourceHealthDetails : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IResourceHealthDetailsInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for Recommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetailsInternal.Recommendation { get => this._recommendation; set { {_recommendation = value;} } } + + /// Internal Acessors for Title + string Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/ResourceHealthDetails.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceHealthDetails.json.cs new file mode 100644 index 000000000000..eac657045f32 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceHealthDetails.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IResourceHealthDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceHealthDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/ResourceList.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceList.PowerShell.cs new file mode 100644 index 000000000000..fda3be46bff4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceList.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Base for all lists of resources. + [System.ComponentModel.TypeConverter(typeof(ResourceListTypeConverter))] + public partial class ResourceList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base for all lists of resources. + [System.ComponentModel.TypeConverter(typeof(ResourceListTypeConverter))] + public partial interface IResourceList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceList.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceList.TypeConverter.cs new file mode 100644 index 000000000000..edf13c77d8e0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceList.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceList.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceList.cs new file mode 100644 index 000000000000..eef18f16e9d0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IResourceList, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/ResourceList.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceList.json.cs new file mode 100644 index 000000000000..435384a03438 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceList.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IResourceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/ResourceTags.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceTags.PowerShell.cs new file mode 100644 index 000000000000..2026afeac198 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceTags.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(ResourceTagsTypeConverter))] + public partial class ResourceTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(ResourceTagsTypeConverter))] + public partial interface IResourceTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceTags.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceTags.TypeConverter.cs new file mode 100644 index 000000000000..51c327c854a5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceTags.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceTags.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceTags.cs new file mode 100644 index 000000000000..016bd3b43880 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Resource tags. + public partial class ResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/ResourceTags.dictionary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceTags.dictionary.cs new file mode 100644 index 000000000000..7d0c7b00dce1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.ResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceTags.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceTags.json.cs new file mode 100644 index 000000000000..d4c9826d3052 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/ResourceTags.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RestoreFileSpecs.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreFileSpecs.PowerShell.cs new file mode 100644 index 000000000000..9f1424bade1f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreFileSpecs.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Restore file specs like file path, type and target folder path info. + [System.ComponentModel.TypeConverter(typeof(RestoreFileSpecsTypeConverter))] + public partial class RestoreFileSpecs + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecs DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RestoreFileSpecs(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecs DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RestoreFileSpecs(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecs FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RestoreFileSpecs(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Path")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecsInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecsInternal)this).Path, global::System.Convert.ToString); + } + if (content.Contains("FileSpecType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecsInternal)this).FileSpecType = (string) content.GetValueForProperty("FileSpecType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecsInternal)this).FileSpecType, global::System.Convert.ToString); + } + if (content.Contains("TargetFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecsInternal)this).TargetFolderPath = (string) content.GetValueForProperty("TargetFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecsInternal)this).TargetFolderPath, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RestoreFileSpecs(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Path")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecsInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecsInternal)this).Path, global::System.Convert.ToString); + } + if (content.Contains("FileSpecType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecsInternal)this).FileSpecType = (string) content.GetValueForProperty("FileSpecType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecsInternal)this).FileSpecType, global::System.Convert.ToString); + } + if (content.Contains("TargetFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecsInternal)this).TargetFolderPath = (string) content.GetValueForProperty("TargetFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecsInternal)this).TargetFolderPath, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Restore file specs like file path, type and target folder path info. + [System.ComponentModel.TypeConverter(typeof(RestoreFileSpecsTypeConverter))] + public partial interface IRestoreFileSpecs + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreFileSpecs.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreFileSpecs.TypeConverter.cs new file mode 100644 index 000000000000..cc4a3ea03b76 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreFileSpecs.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RestoreFileSpecsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecs ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecs).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RestoreFileSpecs.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RestoreFileSpecs.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RestoreFileSpecs.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreFileSpecs.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreFileSpecs.cs new file mode 100644 index 000000000000..a15cf8015866 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IRestoreFileSpecs, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RestoreFileSpecs.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreFileSpecs.json.cs new file mode 100644 index 000000000000..fb28671eccb7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreFileSpecs.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IRestoreFileSpecs. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreFileSpecs. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RestoreRequest.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreRequest.PowerShell.cs new file mode 100644 index 000000000000..672fb8f90fde --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreRequest.PowerShell.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// Base class for restore request. Workload-specific restore requests are derived from this class. + /// + [System.ComponentModel.TypeConverter(typeof(RestoreRequestTypeConverter))] + public partial class RestoreRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RestoreRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RestoreRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RestoreRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RestoreRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequestInternal)this).ObjectType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base class for restore request. Workload-specific restore requests are derived from this class. + [System.ComponentModel.TypeConverter(typeof(RestoreRequestTypeConverter))] + public partial interface IRestoreRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreRequest.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreRequest.TypeConverter.cs new file mode 100644 index 000000000000..e8a4cee8e0a0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreRequest.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RestoreRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRestoreRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RestoreRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RestoreRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RestoreRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreRequest.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreRequest.cs new file mode 100644 index 000000000000..014b13ab38db --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.IRestoreRequest, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/RestoreRequest.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreRequest.json.cs new file mode 100644 index 000000000000..6ad13bf2efee --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/RestoreRequest.json.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IRestoreRequest. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.Api20241115.IRestoreRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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); + } + } + 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.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectory.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectory.PowerShell.cs new file mode 100644 index 000000000000..562a2109a2e0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectory.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// SQLDataDirectory info + [System.ComponentModel.TypeConverter(typeof(SqlDataDirectoryTypeConverter))] + public partial class SqlDataDirectory + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlDataDirectory(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlDataDirectory(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlDataDirectory(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType.CreateFrom); + } + if (content.Contains("Path")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryInternal)this).Path, global::System.Convert.ToString); + } + if (content.Contains("LogicalName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryInternal)this).LogicalName = (string) content.GetValueForProperty("LogicalName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryInternal)this).LogicalName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlDataDirectory(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType.CreateFrom); + } + if (content.Contains("Path")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryInternal)this).Path, global::System.Convert.ToString); + } + if (content.Contains("LogicalName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryInternal)this).LogicalName = (string) content.GetValueForProperty("LogicalName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryInternal)this).LogicalName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// SQLDataDirectory info + [System.ComponentModel.TypeConverter(typeof(SqlDataDirectoryTypeConverter))] + public partial interface ISqlDataDirectory + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectory.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectory.TypeConverter.cs new file mode 100644 index 000000000000..829e2c1fa5af --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectory.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlDataDirectoryTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlDataDirectory.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlDataDirectory.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlDataDirectory.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectory.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectory.cs new file mode 100644 index 000000000000..679f66c66eee --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// SQLDataDirectory info + public partial class SqlDataDirectory : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectory.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectory.json.cs new file mode 100644 index 000000000000..1f15c5cbcd3c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectory.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.ISqlDataDirectory. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectory. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectoryMapping.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectoryMapping.PowerShell.cs new file mode 100644 index 000000000000..eb82b16070af --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectoryMapping.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Encapsulates information regarding data directory + [System.ComponentModel.TypeConverter(typeof(SqlDataDirectoryMappingTypeConverter))] + public partial class SqlDataDirectoryMapping + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMapping DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SqlDataDirectoryMapping(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMapping DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SqlDataDirectoryMapping(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMapping FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SqlDataDirectoryMapping(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MappingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).MappingType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType?) content.GetValueForProperty("MappingType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).MappingType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType.CreateFrom); + } + if (content.Contains("SourceLogicalName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).SourceLogicalName = (string) content.GetValueForProperty("SourceLogicalName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).SourceLogicalName, global::System.Convert.ToString); + } + if (content.Contains("SourcePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).SourcePath = (string) content.GetValueForProperty("SourcePath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).SourcePath, global::System.Convert.ToString); + } + if (content.Contains("TargetPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).TargetPath = (string) content.GetValueForProperty("TargetPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).TargetPath, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SqlDataDirectoryMapping(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MappingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).MappingType = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType?) content.GetValueForProperty("MappingType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).MappingType, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryType.CreateFrom); + } + if (content.Contains("SourceLogicalName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).SourceLogicalName = (string) content.GetValueForProperty("SourceLogicalName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).SourceLogicalName, global::System.Convert.ToString); + } + if (content.Contains("SourcePath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).SourcePath = (string) content.GetValueForProperty("SourcePath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).SourcePath, global::System.Convert.ToString); + } + if (content.Contains("TargetPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).TargetPath = (string) content.GetValueForProperty("TargetPath",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMappingInternal)this).TargetPath, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Encapsulates information regarding data directory + [System.ComponentModel.TypeConverter(typeof(SqlDataDirectoryMappingTypeConverter))] + public partial interface ISqlDataDirectoryMapping + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectoryMapping.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectoryMapping.TypeConverter.cs new file mode 100644 index 000000000000..525b81ae17f0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectoryMapping.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SqlDataDirectoryMappingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMapping ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMapping).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SqlDataDirectoryMapping.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SqlDataDirectoryMapping.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SqlDataDirectoryMapping.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectoryMapping.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectoryMapping.cs new file mode 100644 index 000000000000..e5eae538b755 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Encapsulates information regarding data directory + public partial class SqlDataDirectoryMapping : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMapping, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectoryMapping.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectoryMapping.json.cs new file mode 100644 index 000000000000..c8cb39707df6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/SqlDataDirectoryMapping.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.ISqlDataDirectoryMapping. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ISqlDataDirectoryMapping. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/TargetAfsRestoreInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetAfsRestoreInfo.PowerShell.cs new file mode 100644 index 000000000000..e315a3006126 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetAfsRestoreInfo.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Target Azure File Share Info. + [System.ComponentModel.TypeConverter(typeof(TargetAfsRestoreInfoTypeConverter))] + public partial class TargetAfsRestoreInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TargetAfsRestoreInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TargetAfsRestoreInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TargetAfsRestoreInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("TargetResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfoInternal)this).TargetResourceId = (string) content.GetValueForProperty("TargetResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfoInternal)this).TargetResourceId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TargetAfsRestoreInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("TargetResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfoInternal)this).TargetResourceId = (string) content.GetValueForProperty("TargetResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfoInternal)this).TargetResourceId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Target Azure File Share Info. + [System.ComponentModel.TypeConverter(typeof(TargetAfsRestoreInfoTypeConverter))] + public partial interface ITargetAfsRestoreInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetAfsRestoreInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetAfsRestoreInfo.TypeConverter.cs new file mode 100644 index 000000000000..dc96c616350d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetAfsRestoreInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TargetAfsRestoreInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TargetAfsRestoreInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TargetAfsRestoreInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TargetAfsRestoreInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetAfsRestoreInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetAfsRestoreInfo.cs new file mode 100644 index 000000000000..8f241ba1a68f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + /// Target Azure File Share Info. + public partial class TargetAfsRestoreInfo : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/TargetAfsRestoreInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetAfsRestoreInfo.json.cs new file mode 100644 index 000000000000..4ae96ef64f16 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetAfsRestoreInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.ITargetAfsRestoreInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetAfsRestoreInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/TargetRestoreInfo.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetRestoreInfo.PowerShell.cs new file mode 100644 index 000000000000..b3780057c2cf --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetRestoreInfo.PowerShell.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// Details about target workload during restore operation. + [System.ComponentModel.TypeConverter(typeof(TargetRestoreInfoTypeConverter))] + public partial class TargetRestoreInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TargetRestoreInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TargetRestoreInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TargetRestoreInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).OverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions?) content.GetValueForProperty("OverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).OverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions.CreateFrom); + } + if (content.Contains("ContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).ContainerId = (string) content.GetValueForProperty("ContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).ContainerId, global::System.Convert.ToString); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetDirectoryForFileRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).TargetDirectoryForFileRestore = (string) content.GetValueForProperty("TargetDirectoryForFileRestore",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).TargetDirectoryForFileRestore, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TargetRestoreInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OverwriteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).OverwriteOption = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions?) content.GetValueForProperty("OverwriteOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).OverwriteOption, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptions.CreateFrom); + } + if (content.Contains("ContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).ContainerId = (string) content.GetValueForProperty("ContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).ContainerId, global::System.Convert.ToString); + } + if (content.Contains("DatabaseName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).DatabaseName = (string) content.GetValueForProperty("DatabaseName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).DatabaseName, global::System.Convert.ToString); + } + if (content.Contains("TargetDirectoryForFileRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).TargetDirectoryForFileRestore = (string) content.GetValueForProperty("TargetDirectoryForFileRestore",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfoInternal)this).TargetDirectoryForFileRestore, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Details about target workload during restore operation. + [System.ComponentModel.TypeConverter(typeof(TargetRestoreInfoTypeConverter))] + public partial interface ITargetRestoreInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetRestoreInfo.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetRestoreInfo.TypeConverter.cs new file mode 100644 index 000000000000..9aad864cf2f7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetRestoreInfo.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TargetRestoreInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TargetRestoreInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TargetRestoreInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TargetRestoreInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetRestoreInfo.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetRestoreInfo.cs new file mode 100644 index 000000000000..980f304b5469 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/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.Api20241115 +{ + 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.Api20241115.ITargetRestoreInfo, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/TargetRestoreInfo.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetRestoreInfo.json.cs new file mode 100644 index 000000000000..c88917d675e1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/TargetRestoreInfo.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.Api20241115 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.ITargetRestoreInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ITargetRestoreInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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.DefaultTag/generated/api/Models/Api20241115/WorkloadCrrAccessToken.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/WorkloadCrrAccessToken.PowerShell.cs new file mode 100644 index 000000000000..be999d78c9a3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/WorkloadCrrAccessToken.PowerShell.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(WorkloadCrrAccessTokenTypeConverter))] + public partial class WorkloadCrrAccessToken + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessToken DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkloadCrrAccessToken(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessToken DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkloadCrrAccessToken(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessToken FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal WorkloadCrrAccessToken(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProtectableObjectUniqueName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectUniqueName = (string) content.GetValueForProperty("ProtectableObjectUniqueName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectUniqueName, global::System.Convert.ToString); + } + if (content.Contains("ProtectableObjectFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectFriendlyName = (string) content.GetValueForProperty("ProtectableObjectFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("ProtectableObjectWorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectWorkloadType = (string) content.GetValueForProperty("ProtectableObjectWorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectWorkloadType, global::System.Convert.ToString); + } + if (content.Contains("ProtectableObjectProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectProtectionState = (string) content.GetValueForProperty("ProtectableObjectProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectProtectionState, global::System.Convert.ToString); + } + if (content.Contains("ProtectableObjectContainerHostOSName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectContainerHostOSName = (string) content.GetValueForProperty("ProtectableObjectContainerHostOSName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectContainerHostOSName, global::System.Convert.ToString); + } + if (content.Contains("ProtectableObjectParentLogicalContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectParentLogicalContainerName = (string) content.GetValueForProperty("ProtectableObjectParentLogicalContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectParentLogicalContainerName, global::System.Convert.ToString); + } + if (content.Contains("ContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ContainerId = (string) content.GetValueForProperty("ContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ContainerId, global::System.Convert.ToString); + } + if (content.Contains("PolicyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).PolicyName = (string) content.GetValueForProperty("PolicyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).PolicyName, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("AccessTokenString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).AccessTokenString = (string) content.GetValueForProperty("AccessTokenString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).AccessTokenString, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionContainerId = (long?) content.GetValueForProperty("ProtectionContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionContainerId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RecoveryPointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointId = (string) content.GetValueForProperty("RecoveryPointId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointId, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointTime = (string) content.GetValueForProperty("RecoveryPointTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointTime, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("ContainerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerType = (string) content.GetValueForProperty("ContainerType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerType, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BackupManagementType = (string) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BackupManagementType, global::System.Convert.ToString); + } + if (content.Contains("DatasourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceType = (string) content.GetValueForProperty("DatasourceType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceType, global::System.Convert.ToString); + } + if (content.Contains("DatasourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceName = (string) content.GetValueForProperty("DatasourceName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceName, global::System.Convert.ToString); + } + if (content.Contains("DatasourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceId = (string) content.GetValueForProperty("DatasourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceId, global::System.Convert.ToString); + } + if (content.Contains("DatasourceContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceContainerName = (string) content.GetValueForProperty("DatasourceContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceContainerName, global::System.Convert.ToString); + } + if (content.Contains("CoordinatorServiceStampId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampId = (string) content.GetValueForProperty("CoordinatorServiceStampId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampId, global::System.Convert.ToString); + } + if (content.Contains("CoordinatorServiceStampUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampUri = (string) content.GetValueForProperty("CoordinatorServiceStampUri",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampUri, global::System.Convert.ToString); + } + if (content.Contains("ProtectionServiceStampId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampId = (string) content.GetValueForProperty("ProtectionServiceStampId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionServiceStampUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampUri = (string) content.GetValueForProperty("ProtectionServiceStampUri",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampUri, global::System.Convert.ToString); + } + if (content.Contains("TokenExtendedInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).TokenExtendedInformation = (string) content.GetValueForProperty("TokenExtendedInformation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).TokenExtendedInformation, global::System.Convert.ToString); + } + if (content.Contains("RpTierInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpTierInformation = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation) content.GetValueForProperty("RpTierInformation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpTierInformation, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenRpTierInformationTypeConverter.ConvertFrom); + } + if (content.Contains("RpOriginalSaOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpOriginalSaOption = (bool?) content.GetValueForProperty("RpOriginalSaOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpOriginalSaOption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RpIsManagedVirtualMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpIsManagedVirtualMachine = (bool?) content.GetValueForProperty("RpIsManagedVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpIsManagedVirtualMachine, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RpVMSizeDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpVMSizeDescription = (string) content.GetValueForProperty("RpVMSizeDescription",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpVMSizeDescription, global::System.Convert.ToString); + } + if (content.Contains("BmsActiveRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BmsActiveRegion = (string) content.GetValueForProperty("BmsActiveRegion",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BmsActiveRegion, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkloadCrrAccessToken(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProtectableObjectUniqueName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectUniqueName = (string) content.GetValueForProperty("ProtectableObjectUniqueName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectUniqueName, global::System.Convert.ToString); + } + if (content.Contains("ProtectableObjectFriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectFriendlyName = (string) content.GetValueForProperty("ProtectableObjectFriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectFriendlyName, global::System.Convert.ToString); + } + if (content.Contains("ProtectableObjectWorkloadType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectWorkloadType = (string) content.GetValueForProperty("ProtectableObjectWorkloadType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectWorkloadType, global::System.Convert.ToString); + } + if (content.Contains("ProtectableObjectProtectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectProtectionState = (string) content.GetValueForProperty("ProtectableObjectProtectionState",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectProtectionState, global::System.Convert.ToString); + } + if (content.Contains("ProtectableObjectContainerHostOSName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectContainerHostOSName = (string) content.GetValueForProperty("ProtectableObjectContainerHostOSName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectContainerHostOSName, global::System.Convert.ToString); + } + if (content.Contains("ProtectableObjectParentLogicalContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectParentLogicalContainerName = (string) content.GetValueForProperty("ProtectableObjectParentLogicalContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ProtectableObjectParentLogicalContainerName, global::System.Convert.ToString); + } + if (content.Contains("ContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ContainerId = (string) content.GetValueForProperty("ContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).ContainerId, global::System.Convert.ToString); + } + if (content.Contains("PolicyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).PolicyName = (string) content.GetValueForProperty("PolicyName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).PolicyName, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ObjectType = (string) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ObjectType, global::System.Convert.ToString); + } + if (content.Contains("AccessTokenString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).AccessTokenString = (string) content.GetValueForProperty("AccessTokenString",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).AccessTokenString, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionContainerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionContainerId = (long?) content.GetValueForProperty("ProtectionContainerId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionContainerId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RecoveryPointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointId = (string) content.GetValueForProperty("RecoveryPointId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointId, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointTime = (string) content.GetValueForProperty("RecoveryPointTime",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RecoveryPointTime, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("ContainerType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerType = (string) content.GetValueForProperty("ContainerType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ContainerType, global::System.Convert.ToString); + } + if (content.Contains("BackupManagementType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BackupManagementType = (string) content.GetValueForProperty("BackupManagementType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BackupManagementType, global::System.Convert.ToString); + } + if (content.Contains("DatasourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceType = (string) content.GetValueForProperty("DatasourceType",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceType, global::System.Convert.ToString); + } + if (content.Contains("DatasourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceName = (string) content.GetValueForProperty("DatasourceName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceName, global::System.Convert.ToString); + } + if (content.Contains("DatasourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceId = (string) content.GetValueForProperty("DatasourceId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceId, global::System.Convert.ToString); + } + if (content.Contains("DatasourceContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceContainerName = (string) content.GetValueForProperty("DatasourceContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).DatasourceContainerName, global::System.Convert.ToString); + } + if (content.Contains("CoordinatorServiceStampId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampId = (string) content.GetValueForProperty("CoordinatorServiceStampId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampId, global::System.Convert.ToString); + } + if (content.Contains("CoordinatorServiceStampUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampUri = (string) content.GetValueForProperty("CoordinatorServiceStampUri",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).CoordinatorServiceStampUri, global::System.Convert.ToString); + } + if (content.Contains("ProtectionServiceStampId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampId = (string) content.GetValueForProperty("ProtectionServiceStampId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampId, global::System.Convert.ToString); + } + if (content.Contains("ProtectionServiceStampUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampUri = (string) content.GetValueForProperty("ProtectionServiceStampUri",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).ProtectionServiceStampUri, global::System.Convert.ToString); + } + if (content.Contains("TokenExtendedInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).TokenExtendedInformation = (string) content.GetValueForProperty("TokenExtendedInformation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).TokenExtendedInformation, global::System.Convert.ToString); + } + if (content.Contains("RpTierInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpTierInformation = (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation) content.GetValueForProperty("RpTierInformation",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpTierInformation, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessTokenRpTierInformationTypeConverter.ConvertFrom); + } + if (content.Contains("RpOriginalSaOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpOriginalSaOption = (bool?) content.GetValueForProperty("RpOriginalSaOption",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpOriginalSaOption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RpIsManagedVirtualMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpIsManagedVirtualMachine = (bool?) content.GetValueForProperty("RpIsManagedVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpIsManagedVirtualMachine, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RpVMSizeDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpVMSizeDescription = (string) content.GetValueForProperty("RpVMSizeDescription",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).RpVMSizeDescription, global::System.Convert.ToString); + } + if (content.Contains("BmsActiveRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BmsActiveRegion = (string) content.GetValueForProperty("BmsActiveRegion",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)this).BmsActiveRegion, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + [System.ComponentModel.TypeConverter(typeof(WorkloadCrrAccessTokenTypeConverter))] + public partial interface IWorkloadCrrAccessToken + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/WorkloadCrrAccessToken.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/WorkloadCrrAccessToken.TypeConverter.cs new file mode 100644 index 000000000000..dc7241f615a1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/WorkloadCrrAccessToken.TypeConverter.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.Api20241115 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class WorkloadCrrAccessTokenTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessToken ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessToken).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return WorkloadCrrAccessToken.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return WorkloadCrrAccessToken.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return WorkloadCrrAccessToken.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/WorkloadCrrAccessToken.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/WorkloadCrrAccessToken.cs new file mode 100644 index 000000000000..457564b3a850 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/WorkloadCrrAccessToken.cs @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class WorkloadCrrAccessToken : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessToken, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessTokenInternal, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken __crrAccessToken = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessToken(); + + /// Access token used for authentication + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string AccessTokenString { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).AccessTokenString; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).AccessTokenString = value ?? null; } + + /// Backup Management Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BackupManagementType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).BackupManagementType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).BackupManagementType = value ?? null; } + + /// Active region name of BMS Stamp + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string BmsActiveRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).BmsActiveRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).BmsActiveRegion = value ?? null; } + + /// Backing field for property. + private string _containerId; + + /// Container Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ContainerId { get => this._containerId; set => this._containerId = value; } + + /// Container Unique name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ContainerName = value ?? null; } + + /// Container Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ContainerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ContainerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ContainerType = value ?? null; } + + /// CoordinatorServiceStampId to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string CoordinatorServiceStampId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).CoordinatorServiceStampId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).CoordinatorServiceStampId = value ?? null; } + + /// CoordinatorServiceStampUri to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string CoordinatorServiceStampUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).CoordinatorServiceStampUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).CoordinatorServiceStampUri = value ?? null; } + + /// Datasource Container Unique Name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DatasourceContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).DatasourceContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).DatasourceContainerName = value ?? null; } + + /// Datasource Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DatasourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).DatasourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).DatasourceId = value ?? null; } + + /// Datasource Friendly Name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DatasourceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).DatasourceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).DatasourceName = value ?? null; } + + /// Datasource Type + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string DatasourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).DatasourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).DatasourceType = value ?? null; } + + /// Type of the specific object - used for deserializing + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ObjectType = value ; } + + /// Backing field for property. + private string _policyId; + + /// Policy Id + [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; + + /// Policy Name + [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 _protectableObjectContainerHostOSName; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectableObjectContainerHostOSName { get => this._protectableObjectContainerHostOSName; set => this._protectableObjectContainerHostOSName = value; } + + /// Backing field for property. + private string _protectableObjectFriendlyName; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectableObjectFriendlyName { get => this._protectableObjectFriendlyName; set => this._protectableObjectFriendlyName = value; } + + /// + /// Backing field for property. + /// + private string _protectableObjectParentLogicalContainerName; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectableObjectParentLogicalContainerName { get => this._protectableObjectParentLogicalContainerName; set => this._protectableObjectParentLogicalContainerName = value; } + + /// Backing field for property. + private string _protectableObjectProtectionState; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectableObjectProtectionState { get => this._protectableObjectProtectionState; set => this._protectableObjectProtectionState = value; } + + /// Backing field for property. + private string _protectableObjectUniqueName; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectableObjectUniqueName { get => this._protectableObjectUniqueName; set => this._protectableObjectUniqueName = value; } + + /// Backing field for property. + private string _protectableObjectWorkloadType; + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Owned)] + public string ProtectableObjectWorkloadType { get => this._protectableObjectWorkloadType; set => this._protectableObjectWorkloadType = value; } + + /// Protected item container id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public long? ProtectionContainerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ProtectionContainerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ProtectionContainerId = value ?? default(long); } + + /// ProtectionServiceStampId to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectionServiceStampId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ProtectionServiceStampId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ProtectionServiceStampId = value ?? null; } + + /// ProtectionServiceStampUri to be used by BCM in restore call + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ProtectionServiceStampUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ProtectionServiceStampUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ProtectionServiceStampUri = value ?? null; } + + /// Recovery Point Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RecoveryPointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).RecoveryPointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).RecoveryPointId = value ?? null; } + + /// Recovery Point Time + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RecoveryPointTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).RecoveryPointTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).RecoveryPointTime = value ?? null; } + + /// Resource Group name of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ResourceGroupName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ResourceGroupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ResourceGroupName = value ?? null; } + + /// Resource Id of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ResourceId = value ?? null; } + + /// Resource Name of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string ResourceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ResourceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).ResourceName = value ?? null; } + + /// Recovery point information: Managed virtual machine + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? RpIsManagedVirtualMachine { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).RpIsManagedVirtualMachine; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).RpIsManagedVirtualMachine = value ?? default(bool); } + + /// Recovery point information: Original SA option + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public bool? RpOriginalSaOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).RpOriginalSaOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).RpOriginalSaOption = value ?? default(bool); } + + /// Recovery point Tier Information + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenRpTierInformation RpTierInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).RpTierInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).RpTierInformation = value ?? null /* model class */; } + + /// Recovery point information: VM size description + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string RpVMSizeDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).RpVMSizeDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).RpVMSizeDescription = value ?? null; } + + /// Subscription Id of the source vault + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).SubscriptionId = value ?? null; } + + /// Extended Information about the token like FileSpec etc. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Origin(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.PropertyOrigin.Inherited)] + public string TokenExtendedInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).TokenExtendedInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal)__crrAccessToken).TokenExtendedInformation = 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(__crrAccessToken), __crrAccessToken); + await eventListener.AssertObjectIsValid(nameof(__crrAccessToken), __crrAccessToken); + } + + /// Creates an new instance. + public WorkloadCrrAccessToken() + { + + } + } + public partial interface IWorkloadCrrAccessToken : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken + { + /// Container Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Container Id", + SerializedName = @"containerId", + PossibleTypes = new [] { typeof(string) })] + string ContainerId { get; set; } + /// Policy Id + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy Id", + SerializedName = @"policyId", + PossibleTypes = new [] { typeof(string) })] + string PolicyId { get; set; } + /// Policy Name + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy Name", + SerializedName = @"policyName", + PossibleTypes = new [] { typeof(string) })] + string PolicyName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"protectableObjectContainerHostOsName", + PossibleTypes = new [] { typeof(string) })] + string ProtectableObjectContainerHostOSName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"protectableObjectFriendlyName", + PossibleTypes = new [] { typeof(string) })] + string ProtectableObjectFriendlyName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"protectableObjectParentLogicalContainerName", + PossibleTypes = new [] { typeof(string) })] + string ProtectableObjectParentLogicalContainerName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"protectableObjectProtectionState", + PossibleTypes = new [] { typeof(string) })] + string ProtectableObjectProtectionState { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"protectableObjectUniqueName", + PossibleTypes = new [] { typeof(string) })] + string ProtectableObjectUniqueName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"protectableObjectWorkloadType", + PossibleTypes = new [] { typeof(string) })] + string ProtectableObjectWorkloadType { get; set; } + + } + internal partial interface IWorkloadCrrAccessTokenInternal : + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenInternal + { + /// Container Id + string ContainerId { get; set; } + /// Policy Id + string PolicyId { get; set; } + /// Policy Name + string PolicyName { get; set; } + + string ProtectableObjectContainerHostOSName { get; set; } + + string ProtectableObjectFriendlyName { get; set; } + + string ProtectableObjectParentLogicalContainerName { get; set; } + + string ProtectableObjectProtectionState { get; set; } + + string ProtectableObjectUniqueName { get; set; } + + string ProtectableObjectWorkloadType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/WorkloadCrrAccessToken.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/WorkloadCrrAccessToken.json.cs new file mode 100644 index 000000000000..4b39c5416980 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/Api20241115/WorkloadCrrAccessToken.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.Api20241115 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + public partial class WorkloadCrrAccessToken + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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.Api20241115.IWorkloadCrrAccessToken. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessToken. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IWorkloadCrrAccessToken FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new WorkloadCrrAccessToken(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; + } + __crrAccessToken?.ToJson(container, serializationMode); + AddIf( null != (((object)this._protectableObjectUniqueName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectableObjectUniqueName.ToString()) : null, "protectableObjectUniqueName" ,container.Add ); + AddIf( null != (((object)this._protectableObjectFriendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectableObjectFriendlyName.ToString()) : null, "protectableObjectFriendlyName" ,container.Add ); + AddIf( null != (((object)this._protectableObjectWorkloadType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectableObjectWorkloadType.ToString()) : null, "protectableObjectWorkloadType" ,container.Add ); + AddIf( null != (((object)this._protectableObjectProtectionState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectableObjectProtectionState.ToString()) : null, "protectableObjectProtectionState" ,container.Add ); + AddIf( null != (((object)this._protectableObjectContainerHostOSName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectableObjectContainerHostOSName.ToString()) : null, "protectableObjectContainerHostOsName" ,container.Add ); + AddIf( null != (((object)this._protectableObjectParentLogicalContainerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonString(this._protectableObjectParentLogicalContainerName.ToString()) : null, "protectableObjectParentLogicalContainerName" ,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._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._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 ); + 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 WorkloadCrrAccessToken(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __crrAccessToken = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrAccessToken(json); + {_protectableObjectUniqueName = If( json?.PropertyT("protectableObjectUniqueName"), out var __jsonProtectableObjectUniqueName) ? (string)__jsonProtectableObjectUniqueName : (string)ProtectableObjectUniqueName;} + {_protectableObjectFriendlyName = If( json?.PropertyT("protectableObjectFriendlyName"), out var __jsonProtectableObjectFriendlyName) ? (string)__jsonProtectableObjectFriendlyName : (string)ProtectableObjectFriendlyName;} + {_protectableObjectWorkloadType = If( json?.PropertyT("protectableObjectWorkloadType"), out var __jsonProtectableObjectWorkloadType) ? (string)__jsonProtectableObjectWorkloadType : (string)ProtectableObjectWorkloadType;} + {_protectableObjectProtectionState = If( json?.PropertyT("protectableObjectProtectionState"), out var __jsonProtectableObjectProtectionState) ? (string)__jsonProtectableObjectProtectionState : (string)ProtectableObjectProtectionState;} + {_protectableObjectContainerHostOSName = If( json?.PropertyT("protectableObjectContainerHostOsName"), out var __jsonProtectableObjectContainerHostOSName) ? (string)__jsonProtectableObjectContainerHostOSName : (string)ProtectableObjectContainerHostOSName;} + {_protectableObjectParentLogicalContainerName = If( json?.PropertyT("protectableObjectParentLogicalContainerName"), out var __jsonProtectableObjectParentLogicalContainerName) ? (string)__jsonProtectableObjectParentLogicalContainerName : (string)ProtectableObjectParentLogicalContainerName;} + {_containerId = If( json?.PropertyT("containerId"), out var __jsonContainerId) ? (string)__jsonContainerId : (string)ContainerId;} + {_policyName = If( json?.PropertyT("policyName"), out var __jsonPolicyName) ? (string)__jsonPolicyName : (string)PolicyName;} + {_policyId = If( json?.PropertyT("policyId"), out var __jsonPolicyId) ? (string)__jsonPolicyId : (string)PolicyId;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/RecoveryServicesBackupIdentity.PowerShell.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/RecoveryServicesBackupIdentity.PowerShell.cs new file mode 100644 index 000000000000..1469080db291 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/RecoveryServicesBackupIdentity.PowerShell.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(RecoveryServicesBackupIdentityTypeConverter))] + public partial class RecoveryServicesBackupIdentity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RecoveryServicesBackupIdentity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RecoveryServicesBackupIdentity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RecoveryServicesBackupIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VaultName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).VaultName = (string) content.GetValueForProperty("VaultName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).VaultName, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AzureRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).AzureRegion = (string) content.GetValueForProperty("AzureRegion",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).AzureRegion, global::System.Convert.ToString); + } + if (content.Contains("OperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).OperationId = (string) content.GetValueForProperty("OperationId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).OperationId, global::System.Convert.ToString); + } + if (content.Contains("FabricName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).FabricName = (string) content.GetValueForProperty("FabricName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).FabricName, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("ProtectedItemName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).ProtectedItemName = (string) content.GetValueForProperty("ProtectedItemName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).ProtectedItemName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).RecoveryPointId = (string) content.GetValueForProperty("RecoveryPointId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).RecoveryPointId, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RecoveryServicesBackupIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VaultName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).VaultName = (string) content.GetValueForProperty("VaultName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).VaultName, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AzureRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).AzureRegion = (string) content.GetValueForProperty("AzureRegion",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).AzureRegion, global::System.Convert.ToString); + } + if (content.Contains("OperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).OperationId = (string) content.GetValueForProperty("OperationId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).OperationId, global::System.Convert.ToString); + } + if (content.Contains("FabricName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).FabricName = (string) content.GetValueForProperty("FabricName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).FabricName, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("ProtectedItemName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).ProtectedItemName = (string) content.GetValueForProperty("ProtectedItemName",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).ProtectedItemName, global::System.Convert.ToString); + } + if (content.Contains("RecoveryPointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).RecoveryPointId = (string) content.GetValueForProperty("RecoveryPointId",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).RecoveryPointId, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentityInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(RecoveryServicesBackupIdentityTypeConverter))] + public partial interface IRecoveryServicesBackupIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/RecoveryServicesBackupIdentity.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/RecoveryServicesBackupIdentity.TypeConverter.cs new file mode 100644 index 000000000000..2f142073be28 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/RecoveryServicesBackupIdentity.TypeConverter.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 +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RecoveryServicesBackupIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + // we allow string conversion too. + if (type == typeof(global::System.String)) + { + return true; + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + // support direct string to id type conversion. + if (type == typeof(global::System.String)) + { + return new RecoveryServicesBackupIdentity { Id = sourceValue }; + } + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RecoveryServicesBackupIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RecoveryServicesBackupIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RecoveryServicesBackupIdentity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/RecoveryServicesBackupIdentity.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/RecoveryServicesBackupIdentity.cs new file mode 100644 index 000000000000..95fb2a14272e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/RecoveryServicesBackupIdentity.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 +{ + 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 _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; + + /// Fabric name associated with the container. + [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 _operationId; + + [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 _protectedItemName; + + /// Name of the Protected Item. + [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; + + /// 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 _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 _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 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; } + /// Fabric name associated with the container. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fabric name associated with the container.", + 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; } + + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + string OperationId { get; set; } + /// Name of the Protected Item. + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the Protected Item.", + SerializedName = @"protectedItemName", + PossibleTypes = new [] { typeof(string) })] + string ProtectedItemName { get; set; } + /// 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; } + /// 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; } + /// 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 container. + string ContainerName { get; set; } + /// Fabric name associated with the container. + string FabricName { get; set; } + /// Resource identity path + string Id { get; set; } + + string OperationId { get; set; } + /// Name of the Protected Item. + string ProtectedItemName { get; set; } + /// Recovery Point Id + string RecoveryPointId { get; set; } + /// The name of the resource group where the recovery services vault is present. + string ResourceGroupName { 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.DefaultTag/generated/api/Models/RecoveryServicesBackupIdentity.json.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/RecoveryServicesBackupIdentity.json.cs new file mode 100644 index 000000000000..03c8d49ee3db --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Models/RecoveryServicesBackupIdentity.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 +{ + 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 serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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;} + {_operationId = If( json?.PropertyT("operationId"), out var __jsonOperationId) ? (string)__jsonOperationId : (string)OperationId;} + {_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;} + {_recoveryPointId = If( json?.PropertyT("recoveryPointId"), out var __jsonRecoveryPointId) ? (string)__jsonRecoveryPointId : (string)RecoveryPointId;} + {_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._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._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._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._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.DefaultTag/generated/api/RecoveryServicesBackupClient.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/RecoveryServicesBackupClient.cs new file mode 100644 index 000000000000..ac0e3c20dc70 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/RecoveryServicesBackupClient.cs @@ -0,0 +1,2680 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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 + { + + /// Fetches the AAD properties from target region BCM stamp. + /// Azure region to hit Api + /// 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 AadPropertiesGet(string azureRegion, 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 = @"2024-11-15"; + // 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) + + "/backupAadProperties" + + "?" + + "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.AadPropertiesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Fetches the AAD properties from target region BCM stamp. + /// + /// 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 AadPropertiesGetViaIdentity(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 = @"2024-11-15"; + // 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/(?[^/]+)/backupAadProperties$", 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}/backupAadProperties'"); + } + + // 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 + + "/backupAadProperties" + + "?" + + "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.AadPropertiesGet_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 AadPropertiesGet_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.Api20241115.AadPropertiesResource.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.Api20241115.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. + /// + /// Azure region to hit Api + /// 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 AadPropertiesGet_Validate(string azureRegion, string subscriptionId, string Filter, 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(Filter),Filter); + } + } + + /// Get CRR job details from target region. + /// Azure region to hit Api + /// The subscription Id. + /// CRR Job 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 BackupCrrJobDetailsGet(string azureRegion, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest 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 = @"2024-11-15"; + // 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) + + "/backupCrrJob" + + "?" + + "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.BackupCrrJobDetailsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get CRR job details from target region. + /// + /// CRR Job 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 BackupCrrJobDetailsGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest 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 = @"2024-11-15"; + // 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/(?[^/]+)/backupCrrJob$", 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}/backupCrrJob'"); + } + + // 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 + + "/backupCrrJob" + + "?" + + "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.BackupCrrJobDetailsGet_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 BackupCrrJobDetailsGet_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.Api20241115.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.Api20241115.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. + /// + /// Azure region to hit Api + /// The subscription Id. + /// CRR Job 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 BackupCrrJobDetailsGet_Validate(string azureRegion, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest 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); + } + } + + /// Gets the list of CRR jobs from the target region. + /// Azure region to hit Api + /// The subscription Id. + /// OData filter options. + /// skipToken Filter. + /// Backup CRR Job 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 BackupCrrJobsList(string azureRegion, string subscriptionId, string Filter, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest 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 = @"2024-11-15"; + // 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) + + "/backupCrrJobs" + + "?" + + "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.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.BackupCrrJobsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the list of CRR jobs from the target region. + /// + /// OData filter options. + /// skipToken Filter. + /// Backup CRR Job 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 BackupCrrJobsListViaIdentity(global::System.String viaIdentity, string Filter, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest 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 = @"2024-11-15"; + // 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/(?[^/]+)/backupCrrJobs$", 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}/backupCrrJobs'"); + } + + // 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 + + "/backupCrrJobs" + + "?" + + "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.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.BackupCrrJobsList_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 BackupCrrJobsList_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.Api20241115.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.Api20241115.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. + /// + /// Azure region to hit Api + /// The subscription Id. + /// OData filter options. + /// skipToken Filter. + /// Backup CRR Job 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 BackupCrrJobsList_Validate(string azureRegion, string subscriptionId, string Filter, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest 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(Filter),Filter); + await eventListener.AssertNotNull(nameof(SkipToken),SkipToken); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// 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 BackupProtectedItemsCrrList(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 = @"2024-11-15"; + // 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.BackupProtectedItemsCrrList_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 BackupProtectedItemsCrrListViaIdentity(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 = @"2024-11-15"; + // 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.BackupProtectedItemsCrrList_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 BackupProtectedItemsCrrList_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.Api20241115.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.Api20241115.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. + /// 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 BackupProtectedItemsCrrList_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 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 BackupResourceStorageConfigsGet(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 = @"2024-11-15"; + // 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.BackupResourceStorageConfigsGet_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 BackupResourceStorageConfigsGetViaIdentity(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 = @"2024-11-15"; + // 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.BackupResourceStorageConfigsGet_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 BackupResourceStorageConfigsGet_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.Api20241115.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.Api20241115.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 BackupResourceStorageConfigsGet_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 BackupResourceStorageConfigsPatch(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 = @"2024-11-15"; + // 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.BackupResourceStorageConfigsPatch_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 BackupResourceStorageConfigsPatchViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 = @"2024-11-15"; + // 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.BackupResourceStorageConfigsPatch_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 BackupResourceStorageConfigsPatch_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.Api20241115.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 BackupResourceStorageConfigsPatch_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 BackupResourceStorageConfigsUpdate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 = @"2024-11-15"; + // 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.BackupResourceStorageConfigsUpdate_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 BackupResourceStorageConfigsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 = @"2024-11-15"; + // 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.BackupResourceStorageConfigsUpdate_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 BackupResourceStorageConfigsUpdate_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.Api20241115.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.Api20241115.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 BackupResourceStorageConfigsUpdate_Validate(string vaultName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.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 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). + /// 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 BackupUsageSummariesCrrList(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 = @"2024-11-15"; + // 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.BackupUsageSummariesCrrList_Call(request,onOk,onDefault,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). + /// 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 BackupUsageSummariesCrrListViaIdentity(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 = @"2024-11-15"; + // 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.BackupUsageSummariesCrrList_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 BackupUsageSummariesCrrList_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.Api20241115.BackupManagementUsageList.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.Api20241115.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. + /// 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 BackupUsageSummariesCrrList_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); + } + } + + /// + /// Restores the specified backed up data in a different region as compared to where the data is backed up. + /// + /// Azure region to hit Api + /// The subscription Id. + /// resource cross region restore 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 CrossRegionRestoreTrigger(string azureRegion, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest 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 = @"2024-11-15"; + // 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) + + "/backupCrossRegionRestore" + + "?" + + "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.CrossRegionRestoreTrigger_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Restores the specified backed up data in a different region as compared to where the data is backed up. + /// + /// + /// resource cross region restore 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 CrossRegionRestoreTriggerViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest 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 = @"2024-11-15"; + // 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/(?[^/]+)/backupCrossRegionRestore$", 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}/backupCrossRegionRestore'"); + } + + // 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 + + "/backupCrossRegionRestore" + + "?" + + "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.CrossRegionRestoreTrigger_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 CrossRegionRestoreTrigger_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: azure-async-operation + var _finalUri = _response.GetFirstHeader(@"Azure-AsyncOperation"); + 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? + // 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); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + 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.Api20241115.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. + /// + /// Azure region to hit Api + /// The subscription Id. + /// resource cross region 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 CrossRegionRestoreTrigger_Validate(string azureRegion, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest 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); + } + } + + /// Azure region to hit Api + /// 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 CrrOperationResultsGet(string azureRegion, string subscriptionId, string operationId, global::System.Func 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 = @"2024-11-15"; + // 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) + + "/backupCrrOperationResults/" + + 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.CrrOperationResultsGet_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// 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 CrrOperationResultsGetViaIdentity(global::System.String viaIdentity, global::System.Func 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 = @"2024-11-15"; + // 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/(?[^/]+)/backupCrrOperationResults/(?[^/]+)$", 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}/backupCrrOperationResults/{operationId}'"); + } + + // replace URI parameters with values from identity + var azureRegion = _match.Groups["azureRegion"].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 + + "/providers/Microsoft.RecoveryServices/locations/" + + azureRegion + + "/backupCrrOperationResults/" + + 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.CrrOperationResultsGet_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 CrrOperationResultsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func 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); + 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.Api20241115.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. + /// + /// Azure region to hit Api + /// 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 CrrOperationResultsGet_Validate(string azureRegion, string subscriptionId, string operationId, 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(operationId),operationId); + } + } + + /// Azure region to hit Api + /// 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 CrrOperationStatusGet(string azureRegion, 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 = @"2024-11-15"; + // 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) + + "/backupCrrOperationsStatus/" + + 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.CrrOperationStatusGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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 CrrOperationStatusGetViaIdentity(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 = @"2024-11-15"; + // 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/(?[^/]+)/backupCrrOperationsStatus/(?[^/]+)$", 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}/backupCrrOperationsStatus/{operationId}'"); + } + + // replace URI parameters with values from identity + var azureRegion = _match.Groups["azureRegion"].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 + + "/providers/Microsoft.RecoveryServices/locations/" + + azureRegion + + "/backupCrrOperationsStatus/" + + 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.CrrOperationStatusGet_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 CrrOperationStatusGet_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.Api20241115.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.Api20241115.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. + /// + /// Azure region to hit Api + /// 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 CrrOperationStatusGet_Validate(string azureRegion, string subscriptionId, string operationId, 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(operationId),operationId); + } + } + + /// + /// Provides the information of the backed up data identified using RecoveryPointID. + /// + /// 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 RecoveryPointsCrrGet(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 = @"2024-11-15"; + // 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.RecoveryPointsCrrGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Provides the information of the backed up data identified using RecoveryPointID. + /// + /// + /// 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 RecoveryPointsCrrGetViaIdentity(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 = @"2024-11-15"; + // 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.RecoveryPointsCrrGet_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 RecoveryPointsCrrGet_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.Api20241115.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.Api20241115.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. + /// 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 RecoveryPointsCrrGet_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 RecoveryPointsCrrList(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 = @"2024-11-15"; + // 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.RecoveryPointsCrrList_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 RecoveryPointsCrrListViaIdentity(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 = @"2024-11-15"; + // 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.RecoveryPointsCrrList_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 RecoveryPointsCrrList_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.Api20241115.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.Api20241115.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. + /// 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 RecoveryPointsCrrList_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); + } + } + + /// Returns the Access token for communication between BMS and Protection service + /// 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. + /// Name of the Protected Item. + /// Recovery Point Id + /// Get Access Token request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 400 (BadRequest). + /// 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 RecoveryPointsGetAccessToken(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string recoveryPointId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onBadRequest, 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 = @"2024-11-15"; + // 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) + + "/accessToken" + + "?" + + "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.RecoveryPointsGetAccessToken_Call(request,onOk,onBadRequest,onDefault,eventListener,sender); + } + } + + /// Returns the Access token for communication between BMS and Protection service + /// + /// Get Access Token request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 400 (BadRequest). + /// 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 RecoveryPointsGetAccessTokenViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onBadRequest, 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 = @"2024-11-15"; + // 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/(?[^/]+)/accessToken$", 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}/accessToken'"); + } + + // 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 + + "/accessToken" + + "?" + + "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.RecoveryPointsGetAccessToken_Call(request,onOk,onBadRequest,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 400 (BadRequest). + /// 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 RecoveryPointsGetAccessToken_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onBadRequest, 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.Api20241115.CrrAccessTokenResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.BadRequest: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onBadRequest(_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.Api20241115.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. + /// Fabric name associated with the container. + /// Name of the container. + /// Name of the Protected Item. + /// Recovery Point Id + /// Get Access Token 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 RecoveryPointsGetAccessToken_Validate(string vaultName, string resourceGroupName, string subscriptionId, string fabricName, string containerName, string protectedItemName, string recoveryPointId, Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource 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); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/BackupManagementType.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/BackupManagementType.Completer.cs new file mode 100644 index 000000000000..7374f4da9743 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/BackupManagementType.Completer.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Backup management type to execute the current job. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.BackupManagementTypeTypeConverter))] + public partial struct BackupManagementType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureIaasVM".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureIaasVM'", "AzureIaasVM", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureIaasVM"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MAB".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MAB'", "MAB", global::System.Management.Automation.CompletionResultType.ParameterValue, "MAB"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DPM".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DPM'", "DPM", global::System.Management.Automation.CompletionResultType.ParameterValue, "DPM"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureBackupServer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureBackupServer'", "AzureBackupServer", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureBackupServer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureSql".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureSql'", "AzureSql", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureSql"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureStorage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureStorage'", "AzureStorage", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureStorage"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureWorkload".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureWorkload'", "AzureWorkload", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureWorkload"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DefaultBackup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DefaultBackup'", "DefaultBackup", global::System.Management.Automation.CompletionResultType.ParameterValue, "DefaultBackup"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/BackupManagementType.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/BackupManagementType.TypeConverter.cs new file mode 100644 index 000000000000..ff6e28a965b7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/BackupManagementType.TypeConverter.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.Support +{ + + /// Backup management type to execute the current job. + public partial class BackupManagementTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => BackupManagementType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/BackupManagementType.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/BackupManagementType.cs new file mode 100644 index 000000000000..4db5a1eb437e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/CopyOptions.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/CopyOptions.Completer.cs new file mode 100644 index 000000000000..d0bbf0719996 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/CopyOptions.Completer.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.Support +{ + + /// Options to resolve copy conflicts. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CopyOptionsTypeConverter))] + public partial struct CopyOptions : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CreateCopy".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CreateCopy'", "CreateCopy", global::System.Management.Automation.CompletionResultType.ParameterValue, "CreateCopy"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Skip".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Skip'", "Skip", global::System.Management.Automation.CompletionResultType.ParameterValue, "Skip"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Overwrite".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Overwrite'", "Overwrite", global::System.Management.Automation.CompletionResultType.ParameterValue, "Overwrite"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FailOnConflict".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FailOnConflict'", "FailOnConflict", global::System.Management.Automation.CompletionResultType.ParameterValue, "FailOnConflict"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/CopyOptions.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/CopyOptions.TypeConverter.cs new file mode 100644 index 000000000000..623470c4437d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/CopyOptions.TypeConverter.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.Support +{ + + /// Options to resolve copy conflicts. + public partial class CopyOptionsTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CopyOptions.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/CopyOptions.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/CopyOptions.cs new file mode 100644 index 000000000000..5cd3213fe611 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/CreateMode.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/CreateMode.Completer.cs new file mode 100644 index 000000000000..f91f163f7a1f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/CreateMode.Completer.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.Support +{ + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.CreateModeTypeConverter))] + public partial struct CreateMode : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Default".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Default'", "Default", global::System.Management.Automation.CompletionResultType.ParameterValue, "Default"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Recover".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Recover'", "Recover", global::System.Management.Automation.CompletionResultType.ParameterValue, "Recover"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/CreateMode.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/CreateMode.TypeConverter.cs new file mode 100644 index 000000000000..00fb0006cd1e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/CreateMode.TypeConverter.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.Support +{ + + /// + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// + public partial class CreateModeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CreateMode.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/CreateMode.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/CreateMode.cs new file mode 100644 index 000000000000..4c6726fe3148 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/DataSourceType.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/DataSourceType.Completer.cs new file mode 100644 index 000000000000..75ced0ebe35b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/DataSourceType.Completer.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.Support +{ + + /// Type of workload this item represents. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.DataSourceTypeTypeConverter))] + public partial struct DataSourceType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "VM".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'VM'", "VM", global::System.Management.Automation.CompletionResultType.ParameterValue, "VM"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FileFolder".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FileFolder'", "FileFolder", global::System.Management.Automation.CompletionResultType.ParameterValue, "FileFolder"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureSqlDb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureSqlDb'", "AzureSqlDb", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureSqlDb"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SQLDB".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SQLDB'", "SQLDB", global::System.Management.Automation.CompletionResultType.ParameterValue, "SQLDB"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Exchange".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Exchange'", "Exchange", global::System.Management.Automation.CompletionResultType.ParameterValue, "Exchange"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Sharepoint".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Sharepoint'", "Sharepoint", global::System.Management.Automation.CompletionResultType.ParameterValue, "Sharepoint"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "VMwareVM".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'VMwareVM'", "VMwareVM", global::System.Management.Automation.CompletionResultType.ParameterValue, "VMwareVM"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SystemState".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SystemState'", "SystemState", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemState"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Client".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Client'", "Client", global::System.Management.Automation.CompletionResultType.ParameterValue, "Client"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GenericDataSource".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GenericDataSource'", "GenericDataSource", global::System.Management.Automation.CompletionResultType.ParameterValue, "GenericDataSource"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SQLDataBase".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SQLDataBase'", "SQLDataBase", global::System.Management.Automation.CompletionResultType.ParameterValue, "SQLDataBase"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureFileShare".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureFileShare'", "AzureFileShare", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureFileShare"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SAPHanaDatabase".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SAPHanaDatabase'", "SAPHanaDatabase", global::System.Management.Automation.CompletionResultType.ParameterValue, "SAPHanaDatabase"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SAPAseDatabase".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SAPAseDatabase'", "SAPAseDatabase", global::System.Management.Automation.CompletionResultType.ParameterValue, "SAPAseDatabase"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/DataSourceType.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/DataSourceType.TypeConverter.cs new file mode 100644 index 000000000000..6dffcfdea81d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/DataSourceType.TypeConverter.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.Support +{ + + /// Type of workload this item represents. + public partial class DataSourceTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DataSourceType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/DataSourceType.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/DataSourceType.cs new file mode 100644 index 000000000000..dac7ec53d8cb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/HealthState.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/HealthState.Completer.cs new file mode 100644 index 000000000000..d334a5af91a8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/HealthState.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Health State for the backed up item. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStateTypeConverter))] + public partial struct HealthState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Passed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Passed'", "Passed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Passed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ActionRequired".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ActionRequired'", "ActionRequired", global::System.Management.Automation.CompletionResultType.ParameterValue, "ActionRequired"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ActionSuggested".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ActionSuggested'", "ActionSuggested", global::System.Management.Automation.CompletionResultType.ParameterValue, "ActionSuggested"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/HealthState.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/HealthState.TypeConverter.cs new file mode 100644 index 000000000000..7465e6f54579 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/HealthState.TypeConverter.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.Support +{ + + /// Health State for the backed up item. + public partial class HealthStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => HealthState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/HealthState.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/HealthState.cs new file mode 100644 index 000000000000..a1a1fab2ec2e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/HealthStatus.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/HealthStatus.Completer.cs new file mode 100644 index 000000000000..8d9cdce84967 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/HealthStatus.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// backups running status for this backup item. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.HealthStatusTypeConverter))] + public partial struct HealthStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Passed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Passed'", "Passed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Passed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ActionRequired".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ActionRequired'", "ActionRequired", global::System.Management.Automation.CompletionResultType.ParameterValue, "ActionRequired"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ActionSuggested".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ActionSuggested'", "ActionSuggested", global::System.Management.Automation.CompletionResultType.ParameterValue, "ActionSuggested"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/HealthStatus.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/HealthStatus.TypeConverter.cs new file mode 100644 index 000000000000..7d6a3a2cf191 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/HealthStatus.TypeConverter.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.Support +{ + + /// backups running status for this backup item. + public partial class HealthStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => HealthStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/HealthStatus.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/HealthStatus.cs new file mode 100644 index 000000000000..ed0a893b8102 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 +{ + + /// backups running status for this backup 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 Enum class. + /// 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.DefaultTag/generated/api/Support/JobOperationType.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobOperationType.Completer.cs new file mode 100644 index 000000000000..70f2f26ad1c5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobOperationType.Completer.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.Support +{ + + /// Type of operation. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobOperationTypeTypeConverter))] + public partial struct JobOperationType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Register".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Register'", "Register", global::System.Management.Automation.CompletionResultType.ParameterValue, "Register"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "UnRegister".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'UnRegister'", "UnRegister", global::System.Management.Automation.CompletionResultType.ParameterValue, "UnRegister"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConfigureBackup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ConfigureBackup'", "ConfigureBackup", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConfigureBackup"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Backup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Backup'", "Backup", global::System.Management.Automation.CompletionResultType.ParameterValue, "Backup"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Restore".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Restore'", "Restore", global::System.Management.Automation.CompletionResultType.ParameterValue, "Restore"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DisableBackup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DisableBackup'", "DisableBackup", global::System.Management.Automation.CompletionResultType.ParameterValue, "DisableBackup"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DeleteBackupData".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DeleteBackupData'", "DeleteBackupData", global::System.Management.Automation.CompletionResultType.ParameterValue, "DeleteBackupData"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CrossRegionRestore".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CrossRegionRestore'", "CrossRegionRestore", global::System.Management.Automation.CompletionResultType.ParameterValue, "CrossRegionRestore"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Undelete".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Undelete'", "Undelete", global::System.Management.Automation.CompletionResultType.ParameterValue, "Undelete"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "UpdateCustomerManagedKey".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'UpdateCustomerManagedKey'", "UpdateCustomerManagedKey", global::System.Management.Automation.CompletionResultType.ParameterValue, "UpdateCustomerManagedKey"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobOperationType.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobOperationType.TypeConverter.cs new file mode 100644 index 000000000000..bdb631b5ec70 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobOperationType.TypeConverter.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.Support +{ + + /// Type of operation. + public partial class JobOperationTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => JobOperationType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobOperationType.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobOperationType.cs new file mode 100644 index 000000000000..d93aee49a891 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/JobStatus.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobStatus.Completer.cs new file mode 100644 index 000000000000..5649b928466b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobStatus.Completer.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.Support +{ + + /// Status of the job. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobStatusTypeConverter))] + public partial struct JobStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InProgress".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InProgress'", "InProgress", global::System.Management.Automation.CompletionResultType.ParameterValue, "InProgress"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Completed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Completed'", "Completed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Completed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CompletedWithWarnings".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CompletedWithWarnings'", "CompletedWithWarnings", global::System.Management.Automation.CompletionResultType.ParameterValue, "CompletedWithWarnings"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancelled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Cancelled'", "Cancelled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancelled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancelling".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Cancelling'", "Cancelling", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancelling"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobStatus.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobStatus.TypeConverter.cs new file mode 100644 index 000000000000..dd9966ece42b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobStatus.TypeConverter.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.Support +{ + + /// Status of the job. + public partial class JobStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => JobStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobStatus.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobStatus.cs new file mode 100644 index 000000000000..d4a636e52bde --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/JobSupportedAction.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobSupportedAction.Completer.cs new file mode 100644 index 000000000000..d181445e2db8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobSupportedAction.Completer.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.Support +{ + + /// Argument completer implementation for JobSupportedAction. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.JobSupportedActionTypeConverter))] + public partial struct JobSupportedAction : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancellable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Cancellable'", "Cancellable", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancellable"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Retriable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Retriable'", "Retriable", global::System.Management.Automation.CompletionResultType.ParameterValue, "Retriable"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobSupportedAction.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobSupportedAction.TypeConverter.cs new file mode 100644 index 000000000000..317e20844340 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobSupportedAction.TypeConverter.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.Support +{ + + /// TypeConverter implementation for JobSupportedAction. + public partial class JobSupportedActionTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => JobSupportedAction.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobSupportedAction.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/JobSupportedAction.cs new file mode 100644 index 000000000000..98476c3dabce --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/LastBackupStatus.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/LastBackupStatus.Completer.cs new file mode 100644 index 000000000000..ac30f657a7e4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/LastBackupStatus.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Last backup operation status. Possible values: Healthy, Unhealthy. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.LastBackupStatusTypeConverter))] + public partial struct LastBackupStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Healthy".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Healthy'", "Healthy", global::System.Management.Automation.CompletionResultType.ParameterValue, "Healthy"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unhealthy".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unhealthy'", "Unhealthy", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unhealthy"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "IRPending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'IRPending'", "IRPending", global::System.Management.Automation.CompletionResultType.ParameterValue, "IRPending"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/LastBackupStatus.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/LastBackupStatus.TypeConverter.cs new file mode 100644 index 000000000000..7c0558bacf31 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/LastBackupStatus.TypeConverter.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.Support +{ + + /// Last backup operation status. Possible values: Healthy, Unhealthy. + public partial class LastBackupStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => LastBackupStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/LastBackupStatus.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/LastBackupStatus.cs new file mode 100644 index 000000000000..cf2da2b8021c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/MabServerType.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/MabServerType.Completer.cs new file mode 100644 index 000000000000..3ff97ed2fbc4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/MabServerType.Completer.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.Support +{ + + /// Server type of MAB container. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.MabServerTypeTypeConverter))] + public partial struct MabServerType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unknown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unknown'", "Unknown", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unknown"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "IaasVMContainer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'IaasVMContainer'", "IaasVMContainer", global::System.Management.Automation.CompletionResultType.ParameterValue, "IaasVMContainer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "IaasVMServiceContainer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'IaasVMServiceContainer'", "IaasVMServiceContainer", global::System.Management.Automation.CompletionResultType.ParameterValue, "IaasVMServiceContainer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DPMContainer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DPMContainer'", "DPMContainer", global::System.Management.Automation.CompletionResultType.ParameterValue, "DPMContainer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureBackupServerContainer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureBackupServerContainer'", "AzureBackupServerContainer", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureBackupServerContainer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MABContainer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MABContainer'", "MABContainer", global::System.Management.Automation.CompletionResultType.ParameterValue, "MABContainer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cluster".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Cluster'", "Cluster", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cluster"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureSqlContainer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureSqlContainer'", "AzureSqlContainer", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureSqlContainer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Windows".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Windows'", "Windows", global::System.Management.Automation.CompletionResultType.ParameterValue, "Windows"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "VCenter".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'VCenter'", "VCenter", global::System.Management.Automation.CompletionResultType.ParameterValue, "VCenter"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "VMAppContainer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'VMAppContainer'", "VMAppContainer", global::System.Management.Automation.CompletionResultType.ParameterValue, "VMAppContainer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SQLAGWorkLoadContainer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SQLAGWorkLoadContainer'", "SQLAGWorkLoadContainer", global::System.Management.Automation.CompletionResultType.ParameterValue, "SQLAGWorkLoadContainer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StorageContainer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StorageContainer'", "StorageContainer", global::System.Management.Automation.CompletionResultType.ParameterValue, "StorageContainer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GenericContainer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GenericContainer'", "GenericContainer", global::System.Management.Automation.CompletionResultType.ParameterValue, "GenericContainer"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/MabServerType.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/MabServerType.TypeConverter.cs new file mode 100644 index 000000000000..5e6a8eb45942 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/MabServerType.TypeConverter.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.Support +{ + + /// Server type of MAB container. + public partial class MabServerTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MabServerType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/MabServerType.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/MabServerType.cs new file mode 100644 index 000000000000..bcd01877209a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/OperationStatusValues.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/OperationStatusValues.Completer.cs new file mode 100644 index 000000000000..2d5820b3f5a6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/OperationStatusValues.Completer.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.Support +{ + + /// Operation status. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OperationStatusValuesTypeConverter))] + public partial struct OperationStatusValues : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InProgress".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InProgress'", "InProgress", global::System.Management.Automation.CompletionResultType.ParameterValue, "InProgress"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/OperationStatusValues.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/OperationStatusValues.TypeConverter.cs new file mode 100644 index 000000000000..71669901f45f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/OperationStatusValues.TypeConverter.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.Support +{ + + /// Operation status. + public partial class OperationStatusValuesTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => OperationStatusValues.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/OperationStatusValues.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/OperationStatusValues.cs new file mode 100644 index 000000000000..e160e938369c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/OverwriteOptions.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/OverwriteOptions.Completer.cs new file mode 100644 index 000000000000..fa7668460d0a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/OverwriteOptions.Completer.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.Support +{ + + /// Can Overwrite if Target DataBase already exists + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.OverwriteOptionsTypeConverter))] + public partial struct OverwriteOptions : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FailOnConflict".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FailOnConflict'", "FailOnConflict", global::System.Management.Automation.CompletionResultType.ParameterValue, "FailOnConflict"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Overwrite".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Overwrite'", "Overwrite", global::System.Management.Automation.CompletionResultType.ParameterValue, "Overwrite"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/OverwriteOptions.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/OverwriteOptions.TypeConverter.cs new file mode 100644 index 000000000000..8c4bd7e94c21 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/OverwriteOptions.TypeConverter.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.Support +{ + + /// Can Overwrite if Target DataBase already exists + public partial class OverwriteOptionsTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => OverwriteOptions.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/OverwriteOptions.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/OverwriteOptions.cs new file mode 100644 index 000000000000..25bf8140f6c0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/ProtectedItemHealthStatus.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectedItemHealthStatus.Completer.cs new file mode 100644 index 000000000000..de0251fda8b8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectedItemHealthStatus.Completer.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.Support +{ + + /// Health status of the backup item, evaluated based on last heartbeat received + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemHealthStatusTypeConverter))] + public partial struct ProtectedItemHealthStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Healthy".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Healthy'", "Healthy", global::System.Management.Automation.CompletionResultType.ParameterValue, "Healthy"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unhealthy".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unhealthy'", "Unhealthy", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unhealthy"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotReachable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NotReachable'", "NotReachable", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotReachable"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "IRPending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'IRPending'", "IRPending", global::System.Management.Automation.CompletionResultType.ParameterValue, "IRPending"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectedItemHealthStatus.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectedItemHealthStatus.TypeConverter.cs new file mode 100644 index 000000000000..d6b7007826e2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectedItemHealthStatus.TypeConverter.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.Support +{ + + /// Health status of the backup item, evaluated based on last heartbeat received + public partial class ProtectedItemHealthStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ProtectedItemHealthStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectedItemHealthStatus.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectedItemHealthStatus.cs new file mode 100644 index 000000000000..cc4de1ef89e3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/ProtectedItemState.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectedItemState.Completer.cs new file mode 100644 index 000000000000..049cbcbf44e5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectedItemState.Completer.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Backup state of the backed up item. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectedItemStateTypeConverter))] + public partial struct ProtectedItemState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "IRPending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'IRPending'", "IRPending", global::System.Management.Automation.CompletionResultType.ParameterValue, "IRPending"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Protected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Protected'", "Protected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Protected"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ProtectionError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ProtectionError'", "ProtectionError", global::System.Management.Automation.CompletionResultType.ParameterValue, "ProtectionError"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ProtectionStopped".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ProtectionStopped'", "ProtectionStopped", global::System.Management.Automation.CompletionResultType.ParameterValue, "ProtectionStopped"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ProtectionPaused".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ProtectionPaused'", "ProtectionPaused", global::System.Management.Automation.CompletionResultType.ParameterValue, "ProtectionPaused"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectedItemState.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectedItemState.TypeConverter.cs new file mode 100644 index 000000000000..29374dc2cd48 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectedItemState.TypeConverter.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.Support +{ + + /// Backup state of the backed up item. + public partial class ProtectedItemStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ProtectedItemState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectedItemState.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectedItemState.cs new file mode 100644 index 000000000000..c4efc2af07f3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/ProtectionState.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectionState.Completer.cs new file mode 100644 index 000000000000..be91f87035c3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectionState.Completer.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Backup state of this backup item. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ProtectionStateTypeConverter))] + public partial struct ProtectionState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "IRPending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'IRPending'", "IRPending", global::System.Management.Automation.CompletionResultType.ParameterValue, "IRPending"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Protected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Protected'", "Protected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Protected"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ProtectionError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ProtectionError'", "ProtectionError", global::System.Management.Automation.CompletionResultType.ParameterValue, "ProtectionError"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ProtectionStopped".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ProtectionStopped'", "ProtectionStopped", global::System.Management.Automation.CompletionResultType.ParameterValue, "ProtectionStopped"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ProtectionPaused".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ProtectionPaused'", "ProtectionPaused", global::System.Management.Automation.CompletionResultType.ParameterValue, "ProtectionPaused"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectionState.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectionState.TypeConverter.cs new file mode 100644 index 000000000000..4bd5c5f3b190 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectionState.TypeConverter.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.Support +{ + + /// Backup state of this backup item. + public partial class ProtectionStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ProtectionState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectionState.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ProtectionState.cs new file mode 100644 index 000000000000..41db3e25f3fd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/RecoveryMode.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryMode.Completer.cs new file mode 100644 index 000000000000..04ab73c6b85a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryMode.Completer.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.Support +{ + + /// Defines whether the current recovery mode is file restore or database restore + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryModeTypeConverter))] + public partial struct RecoveryMode : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FileRecovery".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FileRecovery'", "FileRecovery", global::System.Management.Automation.CompletionResultType.ParameterValue, "FileRecovery"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "WorkloadRecovery".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'WorkloadRecovery'", "WorkloadRecovery", global::System.Management.Automation.CompletionResultType.ParameterValue, "WorkloadRecovery"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryMode.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryMode.TypeConverter.cs new file mode 100644 index 000000000000..333d61c04217 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryMode.TypeConverter.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.Support +{ + + /// Defines whether the current recovery mode is file restore or database restore + public partial class RecoveryModeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => RecoveryMode.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryMode.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryMode.cs new file mode 100644 index 000000000000..8a96212227b9 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/RecoveryPointTierStatus.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryPointTierStatus.Completer.cs new file mode 100644 index 000000000000..384186af1fa6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryPointTierStatus.Completer.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.Support +{ + + /// Recovery point tier status. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierStatusTypeConverter))] + public partial struct RecoveryPointTierStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Valid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Valid'", "Valid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Valid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleted'", "Deleted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Rehydrated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Rehydrated'", "Rehydrated", global::System.Management.Automation.CompletionResultType.ParameterValue, "Rehydrated"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryPointTierStatus.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryPointTierStatus.TypeConverter.cs new file mode 100644 index 000000000000..375232aca9c6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryPointTierStatus.TypeConverter.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.Support +{ + + /// Recovery point tier status. + public partial class RecoveryPointTierStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => RecoveryPointTierStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryPointTierStatus.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryPointTierStatus.cs new file mode 100644 index 000000000000..c971d1d2a6fe --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/RecoveryPointTierType.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryPointTierType.Completer.cs new file mode 100644 index 000000000000..8d60a4780be6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryPointTierType.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Recovery point tier type. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryPointTierTypeTypeConverter))] + public partial struct RecoveryPointTierType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InstantRP".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InstantRP'", "InstantRP", global::System.Management.Automation.CompletionResultType.ParameterValue, "InstantRP"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "HardenedRP".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'HardenedRP'", "HardenedRP", global::System.Management.Automation.CompletionResultType.ParameterValue, "HardenedRP"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ArchivedRP".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ArchivedRP'", "ArchivedRP", global::System.Management.Automation.CompletionResultType.ParameterValue, "ArchivedRP"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryPointTierType.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryPointTierType.TypeConverter.cs new file mode 100644 index 000000000000..8f71a5cce1d4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryPointTierType.TypeConverter.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.Support +{ + + /// Recovery point tier type. + public partial class RecoveryPointTierTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => RecoveryPointTierType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryPointTierType.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryPointTierType.cs new file mode 100644 index 000000000000..77a98253c70a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/RecoveryType.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryType.Completer.cs new file mode 100644 index 000000000000..c7cbbbe6c034 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryType.Completer.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.Support +{ + + /// Type of this recovery. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RecoveryTypeTypeConverter))] + public partial struct RecoveryType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "OriginalLocation".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'OriginalLocation'", "OriginalLocation", global::System.Management.Automation.CompletionResultType.ParameterValue, "OriginalLocation"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AlternateLocation".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AlternateLocation'", "AlternateLocation", global::System.Management.Automation.CompletionResultType.ParameterValue, "AlternateLocation"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RestoreDisks".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RestoreDisks'", "RestoreDisks", global::System.Management.Automation.CompletionResultType.ParameterValue, "RestoreDisks"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Offline".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Offline'", "Offline", global::System.Management.Automation.CompletionResultType.ParameterValue, "Offline"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryType.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryType.TypeConverter.cs new file mode 100644 index 000000000000..1cdb623f7778 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryType.TypeConverter.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.Support +{ + + /// Type of this recovery. + public partial class RecoveryTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => RecoveryType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryType.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RecoveryType.cs new file mode 100644 index 000000000000..6d7969a886fe --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/ResourceHealthStatus.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ResourceHealthStatus.Completer.cs new file mode 100644 index 000000000000..27ea798a41a8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ResourceHealthStatus.Completer.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Resource Health Status + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.ResourceHealthStatusTypeConverter))] + public partial struct ResourceHealthStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Healthy".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Healthy'", "Healthy", global::System.Management.Automation.CompletionResultType.ParameterValue, "Healthy"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TransientDegraded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TransientDegraded'", "TransientDegraded", global::System.Management.Automation.CompletionResultType.ParameterValue, "TransientDegraded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PersistentDegraded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PersistentDegraded'", "PersistentDegraded", global::System.Management.Automation.CompletionResultType.ParameterValue, "PersistentDegraded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TransientUnhealthy".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TransientUnhealthy'", "TransientUnhealthy", global::System.Management.Automation.CompletionResultType.ParameterValue, "TransientUnhealthy"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PersistentUnhealthy".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PersistentUnhealthy'", "PersistentUnhealthy", global::System.Management.Automation.CompletionResultType.ParameterValue, "PersistentUnhealthy"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ResourceHealthStatus.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ResourceHealthStatus.TypeConverter.cs new file mode 100644 index 000000000000..712b0d6e3067 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ResourceHealthStatus.TypeConverter.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.Support +{ + + /// Resource Health Status + public partial class ResourceHealthStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ResourceHealthStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ResourceHealthStatus.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/ResourceHealthStatus.cs new file mode 100644 index 000000000000..a676835b110a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/RestorePointQueryType.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestorePointQueryType.Completer.cs new file mode 100644 index 000000000000..df45d3001a91 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestorePointQueryType.Completer.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.Support +{ + + /// RestorePoint type + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointQueryTypeTypeConverter))] + public partial struct RestorePointQueryType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Full".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Full'", "Full", global::System.Management.Automation.CompletionResultType.ParameterValue, "Full"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Log".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Log'", "Log", global::System.Management.Automation.CompletionResultType.ParameterValue, "Log"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Differential".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Differential'", "Differential", global::System.Management.Automation.CompletionResultType.ParameterValue, "Differential"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FullAndDifferential".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FullAndDifferential'", "FullAndDifferential", global::System.Management.Automation.CompletionResultType.ParameterValue, "FullAndDifferential"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "All".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'All'", "All", global::System.Management.Automation.CompletionResultType.ParameterValue, "All"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Incremental".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Incremental'", "Incremental", global::System.Management.Automation.CompletionResultType.ParameterValue, "Incremental"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestorePointQueryType.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestorePointQueryType.TypeConverter.cs new file mode 100644 index 000000000000..2d3f58600690 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestorePointQueryType.TypeConverter.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.Support +{ + + /// RestorePoint type + public partial class RestorePointQueryTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => RestorePointQueryType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestorePointQueryType.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestorePointQueryType.cs new file mode 100644 index 000000000000..f5e7dbdd3cc5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/RestorePointType.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestorePointType.Completer.cs new file mode 100644 index 000000000000..76341ea6b51d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestorePointType.Completer.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.Support +{ + + /// Type of restore point + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestorePointTypeTypeConverter))] + public partial struct RestorePointType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Full".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Full'", "Full", global::System.Management.Automation.CompletionResultType.ParameterValue, "Full"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Log".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Log'", "Log", global::System.Management.Automation.CompletionResultType.ParameterValue, "Log"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Differential".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Differential'", "Differential", global::System.Management.Automation.CompletionResultType.ParameterValue, "Differential"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Incremental".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Incremental'", "Incremental", global::System.Management.Automation.CompletionResultType.ParameterValue, "Incremental"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestorePointType.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestorePointType.TypeConverter.cs new file mode 100644 index 000000000000..44b1030d6cf7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestorePointType.TypeConverter.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.Support +{ + + /// Type of restore point + public partial class RestorePointTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => RestorePointType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestorePointType.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestorePointType.cs new file mode 100644 index 000000000000..0e90337aa488 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/RestoreRequestType.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestoreRequestType.Completer.cs new file mode 100644 index 000000000000..e43b1c04fbf2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestoreRequestType.Completer.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.Support +{ + + /// Restore Type (FullShareRestore or ItemLevelRestore) + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.RestoreRequestTypeTypeConverter))] + public partial struct RestoreRequestType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FullShareRestore".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FullShareRestore'", "FullShareRestore", global::System.Management.Automation.CompletionResultType.ParameterValue, "FullShareRestore"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ItemLevelRestore".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ItemLevelRestore'", "ItemLevelRestore", global::System.Management.Automation.CompletionResultType.ParameterValue, "ItemLevelRestore"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestoreRequestType.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestoreRequestType.TypeConverter.cs new file mode 100644 index 000000000000..00399a2de058 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestoreRequestType.TypeConverter.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.Support +{ + + /// Restore Type (FullShareRestore or ItemLevelRestore) + public partial class RestoreRequestTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => RestoreRequestType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestoreRequestType.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/RestoreRequestType.cs new file mode 100644 index 000000000000..d18dc557171b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/SqlDataDirectoryType.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/SqlDataDirectoryType.Completer.cs new file mode 100644 index 000000000000..b9b16e88685b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/SqlDataDirectoryType.Completer.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.Support +{ + + /// Type of data directory mapping + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.SqlDataDirectoryTypeTypeConverter))] + public partial struct SqlDataDirectoryType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Data".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Data'", "Data", global::System.Management.Automation.CompletionResultType.ParameterValue, "Data"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Log".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Log'", "Log", global::System.Management.Automation.CompletionResultType.ParameterValue, "Log"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/SqlDataDirectoryType.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/SqlDataDirectoryType.TypeConverter.cs new file mode 100644 index 000000000000..ecccf05067eb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/SqlDataDirectoryType.TypeConverter.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.Support +{ + + /// Type of data directory mapping + public partial class SqlDataDirectoryTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SqlDataDirectoryType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/SqlDataDirectoryType.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/SqlDataDirectoryType.cs new file mode 100644 index 000000000000..f12e8117f0dc --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/StorageType.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/StorageType.Completer.cs new file mode 100644 index 000000000000..7ccfdb0bf482 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/StorageType.Completer.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.Support +{ + + /// Storage type + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeTypeConverter))] + public partial struct StorageType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GeoRedundant".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GeoRedundant'", "GeoRedundant", global::System.Management.Automation.CompletionResultType.ParameterValue, "GeoRedundant"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "LocallyRedundant".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'LocallyRedundant'", "LocallyRedundant", global::System.Management.Automation.CompletionResultType.ParameterValue, "LocallyRedundant"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ZoneRedundant".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ZoneRedundant'", "ZoneRedundant", global::System.Management.Automation.CompletionResultType.ParameterValue, "ZoneRedundant"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReadAccessGeoZoneRedundant".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ReadAccessGeoZoneRedundant'", "ReadAccessGeoZoneRedundant", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReadAccessGeoZoneRedundant"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/StorageType.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/StorageType.TypeConverter.cs new file mode 100644 index 000000000000..145d76d0525f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/StorageType.TypeConverter.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.Support +{ + + /// Storage type + public partial class StorageTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => StorageType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/StorageType.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/StorageType.cs new file mode 100644 index 000000000000..9dacf1e50c69 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/StorageTypeState.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/StorageTypeState.Completer.cs new file mode 100644 index 000000000000..fb647a5d5200 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/StorageTypeState.Completer.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.Support +{ + + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeStateTypeConverter))] + public partial struct StorageTypeState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Locked".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Locked'", "Locked", global::System.Management.Automation.CompletionResultType.ParameterValue, "Locked"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unlocked".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unlocked'", "Unlocked", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unlocked"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/StorageTypeState.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/StorageTypeState.TypeConverter.cs new file mode 100644 index 000000000000..97594f11bbae --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/StorageTypeState.TypeConverter.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.Support +{ + + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + public partial class StorageTypeStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => StorageTypeState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/StorageTypeState.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/StorageTypeState.cs new file mode 100644 index 000000000000..f23dd179f1a1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/Type.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/Type.Completer.cs new file mode 100644 index 000000000000..4fddb961c529 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/Type.Completer.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.Support +{ + + /// Backup management type for this container. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.TypeTypeConverter))] + public partial struct Type : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "BackupProtectedItemCountSummary".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'BackupProtectedItemCountSummary'", "BackupProtectedItemCountSummary", global::System.Management.Automation.CompletionResultType.ParameterValue, "BackupProtectedItemCountSummary"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "BackupProtectionContainerCountSummary".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'BackupProtectionContainerCountSummary'", "BackupProtectionContainerCountSummary", global::System.Management.Automation.CompletionResultType.ParameterValue, "BackupProtectionContainerCountSummary"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/Type.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/Type.TypeConverter.cs new file mode 100644 index 000000000000..dd39b225b87f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/Type.TypeConverter.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.Support +{ + + /// Backup management type for this container. + public partial class TypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => Type.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/Type.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/Type.cs new file mode 100644 index 000000000000..eb1b468b6348 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/UsagesUnit.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/UsagesUnit.Completer.cs new file mode 100644 index 000000000000..5f8375044ab7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/UsagesUnit.Completer.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support +{ + + /// Unit of the usage. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.UsagesUnitTypeConverter))] + public partial struct UsagesUnit : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Count".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Count'", "Count", global::System.Management.Automation.CompletionResultType.ParameterValue, "Count"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Bytes".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Bytes'", "Bytes", global::System.Management.Automation.CompletionResultType.ParameterValue, "Bytes"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Seconds".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Seconds'", "Seconds", global::System.Management.Automation.CompletionResultType.ParameterValue, "Seconds"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Percent".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Percent'", "Percent", global::System.Management.Automation.CompletionResultType.ParameterValue, "Percent"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CountPerSecond".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CountPerSecond'", "CountPerSecond", global::System.Management.Automation.CompletionResultType.ParameterValue, "CountPerSecond"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "BytesPerSecond".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'BytesPerSecond'", "BytesPerSecond", global::System.Management.Automation.CompletionResultType.ParameterValue, "BytesPerSecond"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/UsagesUnit.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/UsagesUnit.TypeConverter.cs new file mode 100644 index 000000000000..5168c887219b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/UsagesUnit.TypeConverter.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.Support +{ + + /// Unit of the usage. + public partial class UsagesUnitTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => UsagesUnit.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/UsagesUnit.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/UsagesUnit.cs new file mode 100644 index 000000000000..c42504db1ce4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 Enum class. + /// 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.DefaultTag/generated/api/Support/WorkloadType.Completer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/WorkloadType.Completer.cs new file mode 100644 index 000000000000..6765fa5f08b1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/WorkloadType.Completer.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.Support +{ + + /// Workload type of backup item. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.WorkloadTypeTypeConverter))] + public partial struct WorkloadType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "VM".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'VM'", "VM", global::System.Management.Automation.CompletionResultType.ParameterValue, "VM"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FileFolder".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FileFolder'", "FileFolder", global::System.Management.Automation.CompletionResultType.ParameterValue, "FileFolder"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureSqlDb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureSqlDb'", "AzureSqlDb", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureSqlDb"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SQLDB".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SQLDB'", "SQLDB", global::System.Management.Automation.CompletionResultType.ParameterValue, "SQLDB"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Exchange".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Exchange'", "Exchange", global::System.Management.Automation.CompletionResultType.ParameterValue, "Exchange"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Sharepoint".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Sharepoint'", "Sharepoint", global::System.Management.Automation.CompletionResultType.ParameterValue, "Sharepoint"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "VMwareVM".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'VMwareVM'", "VMwareVM", global::System.Management.Automation.CompletionResultType.ParameterValue, "VMwareVM"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SystemState".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SystemState'", "SystemState", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemState"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Client".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Client'", "Client", global::System.Management.Automation.CompletionResultType.ParameterValue, "Client"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GenericDataSource".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GenericDataSource'", "GenericDataSource", global::System.Management.Automation.CompletionResultType.ParameterValue, "GenericDataSource"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SQLDataBase".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SQLDataBase'", "SQLDataBase", global::System.Management.Automation.CompletionResultType.ParameterValue, "SQLDataBase"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureFileShare".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureFileShare'", "AzureFileShare", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureFileShare"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SAPHanaDatabase".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SAPHanaDatabase'", "SAPHanaDatabase", global::System.Management.Automation.CompletionResultType.ParameterValue, "SAPHanaDatabase"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SAPAseDatabase".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SAPAseDatabase'", "SAPAseDatabase", global::System.Management.Automation.CompletionResultType.ParameterValue, "SAPAseDatabase"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/WorkloadType.TypeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/WorkloadType.TypeConverter.cs new file mode 100644 index 000000000000..8177f7b3383c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/WorkloadType.TypeConverter.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.Support +{ + + /// Workload type of backup item. + public partial class WorkloadTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => WorkloadType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/WorkloadType.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/api/Support/WorkloadType.cs new file mode 100644 index 000000000000..2eedb6abac9d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 +{ + + /// Workload type of backup item. + 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 Enum class. + /// 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.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupAadProperty_Get.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupAadProperty_Get.cs new file mode 100644 index 000000000000..f4300d870cfa --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupAadProperty_Get.cs @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Fetches the AAD properties from target region BCM stamp. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupAadProperties" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupAadProperty_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Fetches the AAD properties from target region BCM stamp.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupAadProperties", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupAadProperty_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _azureRegion; + + /// Azure region to hit Api + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure region to hit Api")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure region to hit Api", + SerializedName = @"azureRegion", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string AzureRegion { get => this._azureRegion; set => this._azureRegion = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// OData filter options. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData filter options.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData filter options.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupAadProperty_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AadPropertiesGet(AzureRegion, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion,SubscriptionId=SubscriptionId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupAadProperty_GetViaIdentity.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupAadProperty_GetViaIdentity.cs new file mode 100644 index 000000000000..6a0bd6425268 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupAadProperty_GetViaIdentity.cs @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Fetches the AAD properties from target region BCM stamp. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupAadProperties" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupAadProperty_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Fetches the AAD properties from target region BCM stamp.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupAadProperties", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupAadProperty_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// OData filter options. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData filter options.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData filter options.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupAadProperty_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AadPropertiesGetViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.AzureRegion) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AzureRegion"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AadPropertiesGet(InputObject.AzureRegion ?? null, InputObject.SubscriptionId ?? null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJobDetail_Get.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJobDetail_Get.cs new file mode 100644 index 000000000000..ccbccbf7b905 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJobDetail_Get.cs @@ -0,0 +1,439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Get CRR job details from target region. + /// + /// [OpenAPI] Get=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupCrrJobDetail_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Get CRR job details from target region.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupCrrJobDetail_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _azureRegion; + + /// Azure region to hit Api + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure region to hit Api")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure region to hit Api", + SerializedName = @"azureRegion", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string AzureRegion { get => this._azureRegion; set => this._azureRegion = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest _parameter; + + /// Request object for fetching CRR jobs. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Request object for fetching CRR jobs.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Request object for fetching CRR jobs.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupCrrJobDetail_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupCrrJobDetailsGet' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupCrrJobDetailsGet(AzureRegion, SubscriptionId, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion,SubscriptionId=SubscriptionId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJobDetail_GetExpanded.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJobDetail_GetExpanded.cs new file mode 100644 index 000000000000..31b9a6b09d33 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJobDetail_GetExpanded.cs @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Get CRR job details from target region. + /// + /// [OpenAPI] Get=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupCrrJobDetail_GetExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Get CRR job details from target region.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupCrrJobDetail_GetExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Request object for fetching CRR jobs. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrJobRequest(); + + /// Backing field for property. + private string _azureRegion; + + /// Azure region to hit Api + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure region to hit Api")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure region to hit Api", + SerializedName = @"azureRegion", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string AzureRegion { get => this._azureRegion; set => this._azureRegion = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Job Name of the job to be fetched + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Job Name of the job to be fetched")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job Name of the job to be fetched", + SerializedName = @"jobName", + PossibleTypes = new [] { typeof(string) })] + public string JobName { get => _parametersBody.JobName ?? null; set => _parametersBody.JobName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Entire ARM resource id of the resource + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Entire ARM resource id of the resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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) })] + public string ResourceId { get => _parametersBody.ResourceId ?? null; set => _parametersBody.ResourceId = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupCrrJobDetail_GetExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupCrrJobDetailsGet' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupCrrJobDetailsGet(AzureRegion, SubscriptionId, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion,SubscriptionId=SubscriptionId,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJobDetail_GetViaIdentity.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJobDetail_GetViaIdentity.cs new file mode 100644 index 000000000000..4ed496b351c4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJobDetail_GetViaIdentity.cs @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Get CRR job details from target region. + /// + /// [OpenAPI] Get=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupCrrJobDetail_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Get CRR job details from target region.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupCrrJobDetail_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest _parameter; + + /// Request object for fetching CRR jobs. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Request object for fetching CRR jobs.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Request object for fetching CRR jobs.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupCrrJobDetail_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupCrrJobDetailsGet' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BackupCrrJobDetailsGetViaIdentity(InputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.AzureRegion) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AzureRegion"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BackupCrrJobDetailsGet(InputObject.AzureRegion ?? null, InputObject.SubscriptionId ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJobDetail_GetViaIdentityExpanded.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJobDetail_GetViaIdentityExpanded.cs new file mode 100644 index 000000000000..4685c052fbb2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJobDetail_GetViaIdentityExpanded.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Get CRR job details from target region. + /// + /// [OpenAPI] Get=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupCrrJobDetail_GetViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Get CRR job details from target region.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupCrrJobDetail_GetViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Request object for fetching CRR jobs. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrJobRequest(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Job Name of the job to be fetched + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Job Name of the job to be fetched")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job Name of the job to be fetched", + SerializedName = @"jobName", + PossibleTypes = new [] { typeof(string) })] + public string JobName { get => _parametersBody.JobName ?? null; set => _parametersBody.JobName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Entire ARM resource id of the resource + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Entire ARM resource id of the resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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) })] + public string ResourceId { get => _parametersBody.ResourceId ?? null; set => _parametersBody.ResourceId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzRecoveryServicesBackupCrrJobDetail_GetViaIdentityExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupCrrJobDetailsGet' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BackupCrrJobDetailsGetViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.AzureRegion) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AzureRegion"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BackupCrrJobDetailsGet(InputObject.AzureRegion ?? null, InputObject.SubscriptionId ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJob_List.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJob_List.cs new file mode 100644 index 000000000000..a421f61ac638 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJob_List.cs @@ -0,0 +1,468 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Gets the list of CRR jobs from the target region. + /// + /// [OpenAPI] List=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJobs" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupCrrJob_List", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Gets the list of CRR jobs from the target region.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJobs", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupCrrJob_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _azureRegion; + + /// Azure region to hit Api + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure region to hit Api")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure region to hit Api", + SerializedName = @"azureRegion", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string AzureRegion { get => this._azureRegion; set => this._azureRegion = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// OData filter options. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData filter options.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData filter options.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest _parameter; + + /// Request object for fetching CRR jobs. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Request object for fetching CRR jobs.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Request object for fetching CRR jobs.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _skipToken; + + /// skipToken Filter. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "skipToken Filter.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"skipToken Filter.", + SerializedName = @"$skipToken", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Query)] + public string SkipToken { get => this._skipToken; set => this._skipToken = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupCrrJob_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupCrrJobsList' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupCrrJobsList(AzureRegion, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion,SubscriptionId=SubscriptionId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJob_ListExpanded.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJob_ListExpanded.cs new file mode 100644 index 000000000000..b5d69dd750ae --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrJob_ListExpanded.cs @@ -0,0 +1,480 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Gets the list of CRR jobs from the target region. + /// + /// [OpenAPI] List=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJobs" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupCrrJob_ListExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Gets the list of CRR jobs from the target region.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJobs", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupCrrJob_ListExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Request object for fetching CRR jobs. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrJobRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrrJobRequest(); + + /// Backing field for property. + private string _azureRegion; + + /// Azure region to hit Api + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure region to hit Api")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure region to hit Api", + SerializedName = @"azureRegion", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string AzureRegion { get => this._azureRegion; set => this._azureRegion = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// OData filter options. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData filter options.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData filter options.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Job Name of the job to be fetched + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Job Name of the job to be fetched")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Job Name of the job to be fetched", + SerializedName = @"jobName", + PossibleTypes = new [] { typeof(string) })] + public string JobName { get => _parametersBody.JobName ?? null; set => _parametersBody.JobName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Entire ARM resource id of the resource + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Entire ARM resource id of the resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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) })] + public string ResourceId { get => _parametersBody.ResourceId ?? null; set => _parametersBody.ResourceId = value; } + + /// Backing field for property. + private string _skipToken; + + /// skipToken Filter. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "skipToken Filter.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"skipToken Filter.", + SerializedName = @"$skipToken", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Query)] + public string SkipToken { get => this._skipToken; set => this._skipToken = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupCrrJob_ListExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupCrrJobsList' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupCrrJobsList(AzureRegion, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion,SubscriptionId=SubscriptionId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IJobResourceList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrOperationResult_Get.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrOperationResult_Get.cs new file mode 100644 index 000000000000..3c183fee4753 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrOperationResult_Get.cs @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationResults/{operationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupCrrOperationResult_Get")] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationResults/{operationId}", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupCrrOperationResult_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _azureRegion; + + /// Azure region to hit Api + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure region to hit Api")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure region to hit Api", + SerializedName = @"azureRegion", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string AzureRegion { get => this._azureRegion; set => this._azureRegion = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _operationId; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string OperationId { get => this._operationId; set => this._operationId = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnAccepted will be called before the regular onAccepted has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onAccepted method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupCrrOperationResult_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.CrrOperationResultsGet(AzureRegion, SubscriptionId, OperationId, onOk, onAccepted, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion,SubscriptionId=SubscriptionId,OperationId=OperationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 202 (Accepted). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onAccepted(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnAccepted(responseMessage, ref _returnNow); + // if overrideOnAccepted has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onAccepted - response for 202 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, OperationId=OperationId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, OperationId=OperationId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrOperationResult_GetViaIdentity.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrOperationResult_GetViaIdentity.cs new file mode 100644 index 000000000000..cf4cb98b06dd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrOperationResult_GetViaIdentity.cs @@ -0,0 +1,454 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationResults/{operationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupCrrOperationResult_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationResults/{operationId}", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupCrrOperationResult_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnAccepted will be called before the regular onAccepted has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onAccepted method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupCrrOperationResult_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.CrrOperationResultsGetViaIdentity(InputObject.Id, onOk, onAccepted, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.AzureRegion) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AzureRegion"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.OperationId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.OperationId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.CrrOperationResultsGet(InputObject.AzureRegion ?? null, InputObject.SubscriptionId ?? null, InputObject.OperationId ?? null, onOk, onAccepted, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 202 (Accepted). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onAccepted(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnAccepted(responseMessage, ref _returnNow); + // if overrideOnAccepted has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onAccepted - response for 202 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrOperationStatus_Get.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrOperationStatus_Get.cs new file mode 100644 index 000000000000..4b8e31b15404 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrOperationStatus_Get.cs @@ -0,0 +1,435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationsStatus/{operationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupCrrOperationStatus_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationsStatus/{operationId}", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupCrrOperationStatus_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _azureRegion; + + /// Azure region to hit Api + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure region to hit Api")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure region to hit Api", + SerializedName = @"azureRegion", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string AzureRegion { get => this._azureRegion; set => this._azureRegion = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _operationId; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string OperationId { get => this._operationId; set => this._operationId = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupCrrOperationStatus_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.CrrOperationStatusGet(AzureRegion, SubscriptionId, OperationId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion,SubscriptionId=SubscriptionId,OperationId=OperationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, OperationId=OperationId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, OperationId=OperationId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrOperationStatus_GetViaIdentity.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrOperationStatus_GetViaIdentity.cs new file mode 100644 index 000000000000..3845d5c97756 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupCrrOperationStatus_GetViaIdentity.cs @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationsStatus/{operationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupCrrOperationStatus_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationsStatus/{operationId}", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupCrrOperationStatus_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupCrrOperationStatus_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.CrrOperationStatusGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.AzureRegion) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AzureRegion"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.OperationId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.OperationId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.CrrOperationStatusGet(InputObject.AzureRegion ?? null, InputObject.SubscriptionId ?? null, InputObject.OperationId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IOperationStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupProtectedItemsCrr_List.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupProtectedItemsCrr_List.cs new file mode 100644 index 000000000000..3a6b2975a301 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupProtectedItemsCrr_List.cs @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Provides a pageable list of all items that are backed up within a vault. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems/" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupProtectedItemsCrr_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Provides a pageable list of all items that are backed up within a vault.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems/", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupProtectedItemsCrr_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// OData filter options. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData filter options.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData filter options.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group where the recovery services vault is present. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group where the recovery services vault is present.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group where the recovery services vault is present.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _skipToken; + + /// skipToken Filter. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "skipToken Filter.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"skipToken Filter.", + SerializedName = @"$skipToken", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Query)] + public string SkipToken { get => this._skipToken; set => this._skipToken = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _vaultName; + + /// The name of the recovery services vault. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the recovery services vault.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the recovery services vault.", + SerializedName = @"vaultName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string VaultName { get => this._vaultName; set => this._vaultName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupProtectedItemsCrr_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupProtectedItemsCrrList(VaultName, ResourceGroupName, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName,ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IProtectedItemResourceList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointAccessToken_Get.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointAccessToken_Get.cs new file mode 100644 index 000000000000..69f5380ffbcf --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointAccessToken_Get.cs @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Returns the Access token for communication between BMS and Protection service + /// + /// [OpenAPI] GetAccessToken=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupRecoveryPointAccessToken_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Returns the Access token for communication between BMS and Protection service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupRecoveryPointAccessToken_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// Name of the container. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the container.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the container.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _fabricName; + + /// Fabric name associated with the container. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Fabric name associated with the container.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Fabric name associated with the container.", + SerializedName = @"fabricName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string FabricName { get => this._fabricName; set => this._fabricName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource _parameter; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource) })] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _protectedItemName; + + /// Name of the Protected Item. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Protected Item.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Protected Item.", + SerializedName = @"protectedItemName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ProtectedItemName { get => this._protectedItemName; set => this._protectedItemName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _recoveryPointId; + + /// Recovery Point Id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Recovery Point Id")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Recovery Point Id", + SerializedName = @"recoveryPointId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + 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. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group where the recovery services vault is present.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group where the recovery services vault is present.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _vaultName; + + /// The name of the recovery services vault. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the recovery services vault.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the recovery services vault.", + SerializedName = @"vaultName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string VaultName { get => this._vaultName; set => this._vaultName = value; } + + /// + /// overrideOnBadRequest will be called before the regular onBadRequest has been processed, allowing customization + /// of what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onBadRequest method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnBadRequest(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupRecoveryPointAccessToken_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RecoveryPointsGetAccessToken' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RecoveryPointsGetAccessToken(VaultName, ResourceGroupName, SubscriptionId, FabricName, ContainerName, ProtectedItemName, RecoveryPointId, Parameter, onOk, onBadRequest, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName,ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,FabricName=FabricName,ContainerName=ContainerName,ProtectedItemName=ProtectedItemName,RecoveryPointId=RecoveryPointId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 400 (BadRequest). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onBadRequest(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnBadRequest(responseMessage, ref _returnNow); + // if overrideOnBadRequest has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onBadRequest - response for 400 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, FabricName=FabricName, ContainerName=ContainerName, ProtectedItemName=ProtectedItemName, RecoveryPointId=RecoveryPointId, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, FabricName=FabricName, ContainerName=ContainerName, ProtectedItemName=ProtectedItemName, RecoveryPointId=RecoveryPointId, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointAccessToken_GetExpanded.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointAccessToken_GetExpanded.cs new file mode 100644 index 000000000000..bbedbd55c906 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointAccessToken_GetExpanded.cs @@ -0,0 +1,629 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Returns the Access token for communication between BMS and Protection service + /// + /// [OpenAPI] GetAccessToken=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupRecoveryPointAccessToken_GetExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Returns the Access token for communication between BMS and Protection service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupRecoveryPointAccessToken_GetExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AadPropertiesResource(); + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"audience", + PossibleTypes = new [] { typeof(string) })] + public string Audience { get => _parametersBody.Audience ?? null; set => _parametersBody.Audience = value; } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"authority", + PossibleTypes = new [] { typeof(string) })] + public string Authority { get => _parametersBody.Authority ?? null; set => _parametersBody.Authority = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// Name of the container. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the container.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the container.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Optional ETag. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional ETag.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional ETag.", + SerializedName = @"eTag", + PossibleTypes = new [] { typeof(string) })] + public string ETag { get => _parametersBody.ETag ?? null; set => _parametersBody.ETag = value; } + + /// Backing field for property. + private string _fabricName; + + /// Fabric name associated with the container. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Fabric name associated with the container.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Fabric name associated with the container.", + SerializedName = @"fabricName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string FabricName { get => this._fabricName; set => this._fabricName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Resource location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _parametersBody.Location ?? null; set => _parametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _protectedItemName; + + /// Name of the Protected Item. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Protected Item.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Protected Item.", + SerializedName = @"protectedItemName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ProtectedItemName { get => this._protectedItemName; set => this._protectedItemName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _recoveryPointId; + + /// Recovery Point Id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Recovery Point Id")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Recovery Point Id", + SerializedName = @"recoveryPointId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + 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. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group where the recovery services vault is present.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group where the recovery services vault is present.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"servicePrincipalClientId", + PossibleTypes = new [] { typeof(string) })] + public string ServicePrincipalClientId { get => _parametersBody.ServicePrincipalClientId ?? null; set => _parametersBody.ServicePrincipalClientId = value; } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"servicePrincipalObjectId", + PossibleTypes = new [] { typeof(string) })] + public string ServicePrincipalObjectId { get => _parametersBody.ServicePrincipalObjectId ?? null; set => _parametersBody.ServicePrincipalObjectId = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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.Api20241115.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string TenantId { get => _parametersBody.TenantId ?? null; set => _parametersBody.TenantId = value; } + + /// Backing field for property. + private string _vaultName; + + /// The name of the recovery services vault. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the recovery services vault.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the recovery services vault.", + SerializedName = @"vaultName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string VaultName { get => this._vaultName; set => this._vaultName = value; } + + /// + /// overrideOnBadRequest will be called before the regular onBadRequest has been processed, allowing customization + /// of what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onBadRequest method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnBadRequest(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzRecoveryServicesBackupRecoveryPointAccessToken_GetExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RecoveryPointsGetAccessToken' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RecoveryPointsGetAccessToken(VaultName, ResourceGroupName, SubscriptionId, FabricName, ContainerName, ProtectedItemName, RecoveryPointId, _parametersBody, onOk, onBadRequest, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName,ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,FabricName=FabricName,ContainerName=ContainerName,ProtectedItemName=ProtectedItemName,RecoveryPointId=RecoveryPointId,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 400 (BadRequest). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onBadRequest(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnBadRequest(responseMessage, ref _returnNow); + // if overrideOnBadRequest has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onBadRequest - response for 400 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, FabricName=FabricName, ContainerName=ContainerName, ProtectedItemName=ProtectedItemName, RecoveryPointId=RecoveryPointId, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, FabricName=FabricName, ContainerName=ContainerName, ProtectedItemName=ProtectedItemName, RecoveryPointId=RecoveryPointId, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentity.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentity.cs new file mode 100644 index 000000000000..573a2de605e6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentity.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.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Returns the Access token for communication between BMS and Protection service + /// + /// [OpenAPI] GetAccessToken=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Returns the Access token for communication between BMS and Protection service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource _parameter; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource) })] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnBadRequest will be called before the regular onBadRequest has been processed, allowing customization + /// of what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onBadRequest method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnBadRequest(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RecoveryPointsGetAccessToken' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.RecoveryPointsGetAccessTokenViaIdentity(InputObject.Id, Parameter, onOk, onBadRequest, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.VaultName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.VaultName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.FabricName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FabricName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProtectedItemName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProtectedItemName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.RecoveryPointId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RecoveryPointId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.RecoveryPointsGetAccessToken(InputObject.VaultName ?? null, InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.FabricName ?? null, InputObject.ContainerName ?? null, InputObject.ProtectedItemName ?? null, InputObject.RecoveryPointId ?? null, Parameter, onOk, onBadRequest, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 400 (BadRequest). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onBadRequest(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnBadRequest(responseMessage, ref _returnNow); + // if overrideOnBadRequest has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onBadRequest - response for 400 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentityExpanded.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentityExpanded.cs new file mode 100644 index 000000000000..85ba30b3af48 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentityExpanded.cs @@ -0,0 +1,568 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Returns the Access token for communication between BMS and Protection service + /// + /// [OpenAPI] GetAccessToken=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Returns the Access token for communication between BMS and Protection service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IAadPropertiesResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.AadPropertiesResource(); + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"audience", + PossibleTypes = new [] { typeof(string) })] + public string Audience { get => _parametersBody.Audience ?? null; set => _parametersBody.Audience = value; } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"authority", + PossibleTypes = new [] { typeof(string) })] + public string Authority { get => _parametersBody.Authority ?? null; set => _parametersBody.Authority = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Optional ETag. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional ETag.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional ETag.", + SerializedName = @"eTag", + PossibleTypes = new [] { typeof(string) })] + public string ETag { get => _parametersBody.ETag ?? null; set => _parametersBody.ETag = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Resource location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _parametersBody.Location ?? null; set => _parametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"servicePrincipalClientId", + PossibleTypes = new [] { typeof(string) })] + public string ServicePrincipalClientId { get => _parametersBody.ServicePrincipalClientId ?? null; set => _parametersBody.ServicePrincipalClientId = value; } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"servicePrincipalObjectId", + PossibleTypes = new [] { typeof(string) })] + public string ServicePrincipalObjectId { get => _parametersBody.ServicePrincipalObjectId ?? null; set => _parametersBody.ServicePrincipalObjectId = value; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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.Api20241115.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string TenantId { get => _parametersBody.TenantId ?? null; set => _parametersBody.TenantId = value; } + + /// + /// overrideOnBadRequest will be called before the regular onBadRequest has been processed, allowing customization + /// of what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onBadRequest method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnBadRequest(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupRecoveryPointAccessToken_GetViaIdentityExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RecoveryPointsGetAccessToken' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.RecoveryPointsGetAccessTokenViaIdentity(InputObject.Id, _parametersBody, onOk, onBadRequest, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.VaultName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.VaultName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.FabricName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FabricName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProtectedItemName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProtectedItemName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.RecoveryPointId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RecoveryPointId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.RecoveryPointsGetAccessToken(InputObject.VaultName ?? null, InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.FabricName ?? null, InputObject.ContainerName ?? null, InputObject.ProtectedItemName ?? null, InputObject.RecoveryPointId ?? null, _parametersBody, onOk, onBadRequest, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 400 (BadRequest). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onBadRequest(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnBadRequest(responseMessage, ref _returnNow); + // if overrideOnBadRequest has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onBadRequest - response for 400 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessTokenResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointsCrr_Get.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointsCrr_Get.cs new file mode 100644 index 000000000000..653f9f9a5e69 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointsCrr_Get.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.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// + /// Provides the information of the backed up data identified using RecoveryPointID. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupRecoveryPointsCrr_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Provides the information of the backed up data identified using RecoveryPointID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupRecoveryPointsCrr_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// Container name associated with backed up item. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Container name associated with backed up item.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Container name associated with backed up item.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _fabricName; + + /// Fabric name associated with backed up item. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Fabric name associated with backed up item.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Fabric name associated with backed up item.", + SerializedName = @"fabricName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string FabricName { get => this._fabricName; set => this._fabricName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _protectedItemName; + + /// Backed up item name whose backup data needs to be fetched. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Backed up item name whose backup data needs to be fetched.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Backed up item name whose backup data needs to be fetched.", + SerializedName = @"protectedItemName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ProtectedItemName { get => this._protectedItemName; set => this._protectedItemName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _recoveryPointId; + + /// RecoveryPointID represents the backed up data to be fetched. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "RecoveryPointID represents the backed up data to be fetched.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"RecoveryPointID represents the backed up data to be fetched.", + SerializedName = @"recoveryPointId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + 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. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group where the recovery services vault is present.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group where the recovery services vault is present.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _vaultName; + + /// The name of the recovery services vault. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the recovery services vault.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the recovery services vault.", + SerializedName = @"vaultName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string VaultName { get => this._vaultName; set => this._vaultName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupRecoveryPointsCrr_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RecoveryPointsCrrGet(VaultName, ResourceGroupName, SubscriptionId, FabricName, ContainerName, ProtectedItemName, RecoveryPointId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName,ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,FabricName=FabricName,ContainerName=ContainerName,ProtectedItemName=ProtectedItemName,RecoveryPointId=RecoveryPointId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, FabricName=FabricName, ContainerName=ContainerName, ProtectedItemName=ProtectedItemName, RecoveryPointId=RecoveryPointId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, FabricName=FabricName, ContainerName=ContainerName, ProtectedItemName=ProtectedItemName, RecoveryPointId=RecoveryPointId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointsCrr_GetViaIdentity.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointsCrr_GetViaIdentity.cs new file mode 100644 index 000000000000..eb9ec07ff893 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointsCrr_GetViaIdentity.cs @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// + /// Provides the information of the backed up data identified using RecoveryPointID. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupRecoveryPointsCrr_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Provides the information of the backed up data identified using RecoveryPointID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupRecoveryPointsCrr_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupRecoveryPointsCrr_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.RecoveryPointsCrrGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.VaultName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.VaultName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.FabricName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FabricName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ProtectedItemName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ProtectedItemName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.RecoveryPointId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RecoveryPointId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.RecoveryPointsCrrGet(InputObject.VaultName ?? null, InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.FabricName ?? null, InputObject.ContainerName ?? null, InputObject.ProtectedItemName ?? null, InputObject.RecoveryPointId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointsCrr_List.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointsCrr_List.cs new file mode 100644 index 000000000000..89a0b022290d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupRecoveryPointsCrr_List.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Lists the backup copies for the backed up item. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupRecoveryPointsCrr_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Lists the backup copies for the backed up item.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupRecoveryPointsCrr_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// Container name associated with the backed up item. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Container name associated with the backed up item.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Container name associated with the backed up item.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _fabricName; + + /// Fabric name associated with the backed up item. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Fabric name associated with the backed up item.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Fabric name associated with the backed up item.", + SerializedName = @"fabricName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string FabricName { get => this._fabricName; set => this._fabricName = value; } + + /// Backing field for property. + private string _filter; + + /// OData filter options. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData filter options.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData filter options.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _protectedItemName; + + /// Backed up item whose backup copies are to be fetched. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Backed up item whose backup copies are to be fetched.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Backed up item whose backup copies are to be fetched.", + SerializedName = @"protectedItemName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ProtectedItemName { get => this._protectedItemName; set => this._protectedItemName = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group where the recovery services vault is present. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group where the recovery services vault is present.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group where the recovery services vault is present.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _vaultName; + + /// The name of the recovery services vault. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the recovery services vault.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the recovery services vault.", + SerializedName = @"vaultName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string VaultName { get => this._vaultName; set => this._vaultName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupRecoveryPointsCrr_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RecoveryPointsCrrList(VaultName, ResourceGroupName, SubscriptionId, FabricName, ContainerName, ProtectedItemName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName,ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,FabricName=FabricName,ContainerName=ContainerName,ProtectedItemName=ProtectedItemName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, FabricName=FabricName, ContainerName=ContainerName, ProtectedItemName=ProtectedItemName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, FabricName=FabricName, ContainerName=ContainerName, ProtectedItemName=ProtectedItemName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IRecoveryPointResourceList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupResourceStorageConfig_Get.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupResourceStorageConfig_Get.cs new file mode 100644 index 000000000000..6794132a26ab --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupResourceStorageConfig_Get.cs @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Fetches resource storage config. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupResourceStorageConfig_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Fetches resource storage config.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupResourceStorageConfig_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group where the recovery services vault is present. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group where the recovery services vault is present.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group where the recovery services vault is present.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _vaultName; + + /// The name of the recovery services vault. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the recovery services vault.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the recovery services vault.", + SerializedName = @"vaultName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string VaultName { get => this._vaultName; set => this._vaultName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupResourceStorageConfig_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupResourceStorageConfigsGet(VaultName, ResourceGroupName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName,ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupResourceStorageConfig_GetViaIdentity.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupResourceStorageConfig_GetViaIdentity.cs new file mode 100644 index 000000000000..358da56682b7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupResourceStorageConfig_GetViaIdentity.cs @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Fetches resource storage config. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupResourceStorageConfig_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Fetches resource storage config.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupResourceStorageConfig_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzRecoveryServicesBackupResourceStorageConfig_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BackupResourceStorageConfigsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.VaultName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.VaultName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BackupResourceStorageConfigsGet(InputObject.VaultName ?? null, InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupUsageSummariesCrr_List.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupUsageSummariesCrr_List.cs new file mode 100644 index 000000000000..6909297a0e6d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/GetAzRecoveryServicesBackupUsageSummariesCrr_List.cs @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Fetches the backup management usage summaries of the vault. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupUsageSummaries" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRecoveryServicesBackupUsageSummariesCrr_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsage))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Fetches the backup management usage summaries of the vault.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupUsageSummaries", ApiVersion = "2024-11-15")] + public partial class GetAzRecoveryServicesBackupUsageSummariesCrr_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// OData filter options. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData filter options.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData filter options.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group where the recovery services vault is present. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group where the recovery services vault is present.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group where the recovery services vault is present.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _skipToken; + + /// skipToken Filter. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "skipToken Filter.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"skipToken Filter.", + SerializedName = @"$skipToken", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Query)] + public string SkipToken { get => this._skipToken; set => this._skipToken = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _vaultName; + + /// The name of the recovery services vault. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the recovery services vault.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the recovery services vault.", + SerializedName = @"vaultName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string VaultName { get => this._vaultName; set => this._vaultName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzRecoveryServicesBackupUsageSummariesCrr_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupUsageSummariesCrrList(VaultName, ResourceGroupName, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName,ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupManagementUsageList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/StartAzRecoveryServicesBackupCrossRegionRestore_Trigger.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/StartAzRecoveryServicesBackupCrossRegionRestore_Trigger.cs new file mode 100644 index 000000000000..73557223a70f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/StartAzRecoveryServicesBackupCrossRegionRestore_Trigger.cs @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// + /// Restores the specified backed up data in a different region as compared to where the data is backed up. + /// + /// + /// [OpenAPI] Trigger=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzRecoveryServicesBackupCrossRegionRestore_Trigger", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Restores the specified backed up data in a different region as compared to where the data is backed up.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore", ApiVersion = "2024-11-15")] + public partial class StartAzRecoveryServicesBackupCrossRegionRestore_Trigger : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Backing field for property. + private string _azureRegion; + + /// Azure region to hit Api + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure region to hit Api")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure region to hit Api", + SerializedName = @"azureRegion", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string AzureRegion { get => this._azureRegion; set => this._azureRegion = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest _parameter; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StartAzRecoveryServicesBackupCrossRegionRestore_Trigger + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets.StartAzRecoveryServicesBackupCrossRegionRestore_Trigger Clone() + { + var clone = new StartAzRecoveryServicesBackupCrossRegionRestore_Trigger(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.AzureRegion = this.AzureRegion; + clone.SubscriptionId = this.SubscriptionId; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'CrossRegionRestoreTrigger' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.CrossRegionRestoreTrigger(AzureRegion, SubscriptionId, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion,SubscriptionId=SubscriptionId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StartAzRecoveryServicesBackupCrossRegionRestore_Trigger() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/StartAzRecoveryServicesBackupCrossRegionRestore_TriggerExpanded.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/StartAzRecoveryServicesBackupCrossRegionRestore_TriggerExpanded.cs new file mode 100644 index 000000000000..ecabefa314ad --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/StartAzRecoveryServicesBackupCrossRegionRestore_TriggerExpanded.cs @@ -0,0 +1,525 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// + /// Restores the specified backed up data in a different region as compared to where the data is backed up. + /// + /// + /// [OpenAPI] Trigger=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzRecoveryServicesBackupCrossRegionRestore_TriggerExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Restores the specified backed up data in a different region as compared to where the data is backed up.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore", ApiVersion = "2024-11-15")] + public partial class StartAzRecoveryServicesBackupCrossRegionRestore_TriggerExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrossRegionRestoreRequest(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Backing field for property. + private string _azureRegion; + + /// Azure region to hit Api + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure region to hit Api")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure region to hit Api", + SerializedName = @"azureRegion", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string AzureRegion { get => this._azureRegion; set => this._azureRegion = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// Access details for cross region restore + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Access details for cross region restore")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access details for cross region restore", + SerializedName = @"crossRegionRestoreAccessDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken) })] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken CrossRegionRestoreAccessDetail { get => _parametersBody.CrossRegionRestoreAccessDetail ?? null /* object */; set => _parametersBody.CrossRegionRestoreAccessDetail = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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) })] + public string RestoreRequestObjectType { get => _parametersBody.RestoreRequestObjectType ?? null; set => _parametersBody.RestoreRequestObjectType = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StartAzRecoveryServicesBackupCrossRegionRestore_TriggerExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets.StartAzRecoveryServicesBackupCrossRegionRestore_TriggerExpanded Clone() + { + var clone = new StartAzRecoveryServicesBackupCrossRegionRestore_TriggerExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._parametersBody = this._parametersBody; + clone.AzureRegion = this.AzureRegion; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'CrossRegionRestoreTrigger' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.CrossRegionRestoreTrigger(AzureRegion, SubscriptionId, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion,SubscriptionId=SubscriptionId,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public StartAzRecoveryServicesBackupCrossRegionRestore_TriggerExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AzureRegion=AzureRegion, SubscriptionId=SubscriptionId, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentity.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentity.cs new file mode 100644 index 000000000000..42a19d716107 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentity.cs @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// + /// Restores the specified backed up data in a different region as compared to where the data is backed up. + /// + /// + /// [OpenAPI] Trigger=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Restores the specified backed up data in a different region as compared to where the data is backed up.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore", ApiVersion = "2024-11-15")] + public partial class StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest _parameter; + + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets.StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentity Clone() + { + var clone = new StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'CrossRegionRestoreTrigger' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.CrossRegionRestoreTriggerViaIdentity(InputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.AzureRegion) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AzureRegion"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.CrossRegionRestoreTrigger(InputObject.AzureRegion ?? null, InputObject.SubscriptionId ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentityExpanded.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentityExpanded.cs new file mode 100644 index 000000000000..dbcfe1692b7e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentityExpanded.cs @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// + /// Restores the specified backed up data in a different region as compared to where the data is backed up. + /// + /// + /// [OpenAPI] Trigger=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Restores the specified backed up data in a different region as compared to where the data is backed up.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore", ApiVersion = "2024-11-15")] + public partial class StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrossRegionRestoreRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.CrossRegionRestoreRequest(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// Access details for cross region restore + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Access details for cross region restore")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access details for cross region restore", + SerializedName = @"crossRegionRestoreAccessDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken) })] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.ICrrAccessToken CrossRegionRestoreAccessDetail { get => _parametersBody.CrossRegionRestoreAccessDetail ?? null /* object */; set => _parametersBody.CrossRegionRestoreAccessDetail = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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) })] + public string RestoreRequestObjectType { get => _parametersBody.RestoreRequestObjectType ?? null; set => _parametersBody.RestoreRequestObjectType = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets.StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentityExpanded Clone() + { + var clone = new StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._parametersBody = this._parametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'CrossRegionRestoreTrigger' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.CrossRegionRestoreTriggerViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.AzureRegion) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AzureRegion"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.CrossRegionRestoreTrigger(InputObject.AzureRegion ?? null, InputObject.SubscriptionId ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StartAzRecoveryServicesBackupCrossRegionRestore_TriggerViaIdentityExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/UpdateAzRecoveryServicesBackupResourceStorageConfig_Patch.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/UpdateAzRecoveryServicesBackupResourceStorageConfig_Patch.cs new file mode 100644 index 000000000000..e88acb63aba2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/UpdateAzRecoveryServicesBackupResourceStorageConfig_Patch.cs @@ -0,0 +1,455 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Updates vault storage model type. + /// + /// [OpenAPI] Patch=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRecoveryServicesBackupResourceStorageConfig_Patch", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Updates vault storage model type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", ApiVersion = "2024-11-15")] + public partial class UpdateAzRecoveryServicesBackupResourceStorageConfig_Patch : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource _parameter; + + /// The resource storage details. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource storage details.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource storage details.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource) })] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group where the recovery services vault is present. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group where the recovery services vault is present.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group where the recovery services vault is present.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _vaultName; + + /// The name of the recovery services vault. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the recovery services vault.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the recovery services vault.", + SerializedName = @"vaultName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string VaultName { get => this._vaultName; set => this._vaultName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupResourceStorageConfigsPatch' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupResourceStorageConfigsPatch(VaultName, ResourceGroupName, SubscriptionId, Parameter, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName,ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzRecoveryServicesBackupResourceStorageConfig_Patch() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/UpdateAzRecoveryServicesBackupResourceStorageConfig_PatchExpanded.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/UpdateAzRecoveryServicesBackupResourceStorageConfig_PatchExpanded.cs new file mode 100644 index 000000000000..06f117c9b109 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/UpdateAzRecoveryServicesBackupResourceStorageConfig_PatchExpanded.cs @@ -0,0 +1,529 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Updates vault storage model type. + /// + /// [OpenAPI] Patch=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRecoveryServicesBackupResourceStorageConfig_PatchExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Updates vault storage model type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", ApiVersion = "2024-11-15")] + public partial class UpdateAzRecoveryServicesBackupResourceStorageConfig_PatchExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The resource storage details. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BackupResourceConfigResource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// Opt in details of Cross Region Restore feature. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Opt in details of Cross Region Restore feature.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter CrossRegionRestoreFlag { get => _parametersBody.CrossRegionRestoreFlag ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.CrossRegionRestoreFlag = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Optional ETag. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional ETag.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional ETag.", + SerializedName = @"eTag", + PossibleTypes = new [] { typeof(string) })] + public string ETag { get => _parametersBody.ETag ?? null; set => _parametersBody.ETag = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Resource location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _parametersBody.Location ?? null; set => _parametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group where the recovery services vault is present. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group where the recovery services vault is present.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group where the recovery services vault is present.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Storage type + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Storage type")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType))] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType StorageModelType { get => _parametersBody.StorageModelType ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType)""); set => _parametersBody.StorageModelType = value; } + + /// Storage type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Storage type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType))] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType StorageType { get => _parametersBody.StorageType ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType)""); set => _parametersBody.StorageType = value; } + + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState))] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState StorageTypeState { get => _parametersBody.StorageTypeState ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState)""); set => _parametersBody.StorageTypeState = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription Id.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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.Api20241115.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + + /// Backing field for property. + private string _vaultName; + + /// The name of the recovery services vault. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the recovery services vault.")] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the recovery services vault.", + SerializedName = @"vaultName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public string VaultName { get => this._vaultName; set => this._vaultName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupResourceStorageConfigsPatch' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupResourceStorageConfigsPatch(VaultName, ResourceGroupName, SubscriptionId, _parametersBody, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName,ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public UpdateAzRecoveryServicesBackupResourceStorageConfig_PatchExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VaultName=VaultName, ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/UpdateAzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentity.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/UpdateAzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentity.cs new file mode 100644 index 000000000000..556da7e398de --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/UpdateAzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentity.cs @@ -0,0 +1,438 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Updates vault storage model type. + /// + /// [OpenAPI] Patch=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Updates vault storage model type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", ApiVersion = "2024-11-15")] + public partial class UpdateAzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource _parameter; + + /// The resource storage details. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource storage details.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource storage details.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource) })] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupResourceStorageConfigsPatch' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BackupResourceStorageConfigsPatchViaIdentity(InputObject.Id, Parameter, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.VaultName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.VaultName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BackupResourceStorageConfigsPatch(InputObject.VaultName ?? null, InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, Parameter, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public UpdateAzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentity() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/UpdateAzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentityExpanded.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/UpdateAzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentityExpanded.cs new file mode 100644 index 000000000000..2d808eb0068c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/cmdlets/UpdateAzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentityExpanded.cs @@ -0,0 +1,511 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + using System; + + /// Updates vault storage model type. + /// + /// [OpenAPI] Patch=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Description(@"Updates vault storage model type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", ApiVersion = "2024-11-15")] + public partial class UpdateAzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The resource storage details. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IBackupResourceConfigResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.BackupResourceConfigResource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.RecoveryServicesBackupClient Client => Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.ClientAPI; + + /// Opt in details of Cross Region Restore feature. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Opt in details of Cross Region Restore feature.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter CrossRegionRestoreFlag { get => _parametersBody.CrossRegionRestoreFlag ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.CrossRegionRestoreFlag = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Optional ETag. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional ETag.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional ETag.", + SerializedName = @"eTag", + PossibleTypes = new [] { typeof(string) })] + public string ETag { get => _parametersBody.ETag ?? null; set => _parametersBody.ETag = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.IRecoveryServicesBackupIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Resource location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _parametersBody.Location ?? null; set => _parametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Storage type + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Storage type")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType))] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType StorageModelType { get => _parametersBody.StorageModelType ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType)""); set => _parametersBody.StorageModelType = value; } + + /// Storage type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Storage type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType))] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType StorageType { get => _parametersBody.StorageType ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageType)""); set => _parametersBody.StorageType = value; } + + /// + /// Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState))] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState StorageTypeState { get => _parametersBody.StorageTypeState ?? ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support.StorageTypeState)""); set => _parametersBody.StorageTypeState = value; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.ParameterCategory.Body)] + [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.Api20241115.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.IResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupResourceStorageConfigsPatch' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BackupResourceStorageConfigsPatchViaIdentity(InputObject.Id, _parametersBody, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.VaultName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.VaultName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BackupResourceStorageConfigsPatch(InputObject.VaultName ?? null, InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, _parametersBody, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzRecoveryServicesBackupResourceStorageConfig_PatchViaIdentityExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models.Api20241115.INewErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.format.ps1xml b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.format.ps1xml new file mode 100644 index 000000000000..4d28aa4b2f4f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.format.ps1xml @@ -0,0 +1,554 @@ + + + + + AzureErrorRecords + + Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord + Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + AzureErrorRecords + + + $_.InvocationInfo.HistoryId + + + + + + + + ErrorCategory + + + ErrorDetail + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + + $_.InvocationInfo.BoundParameters + + + + $_.InvocationInfo.UnboundParameters + + + + $_.InvocationInfo.HistoryId + + + + + + + AzureErrorRecords + $_.GetType() -eq [Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord] + + + + + RequestId + + + Message + + + ServerMessage + + + ServerResponse + + + RequestMessage + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + StackTrace + + + + $_.InvocationInfo.HistoryId + + + + + + + AzureErrorRecords + $_.GetType() -eq [Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord] + + + + + Message + + + StackTrace + + + + $_.Exception.GetType() + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + + $_.InvocationInfo.HistoryId + + + + + + + + Microsoft.Azure.Commands.Profile.CommonModule.PSAzureServiceProfile + + Microsoft.Azure.Commands.Profile.CommonModule.PSAzureServiceProfile + + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Description + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + + + + + + Token + + + ExpiresOn + + + Type + + + TenantId + + + UserId + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscriptionPolicy + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscriptionPolicy + + + + + Left + + + + Left + + + + Left + + + + + + + + Left + locationPlacementId + + + Left + QuotaId + + + Left + SpendingLimit + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + Id + + + Type + + + Tenants + + + Credential + + + TenantMap + + + CertificateThumbprint + + + + $_.ExtendedProperties.GetEnumerator() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSConfig + + Microsoft.Azure.Commands.Profile.Models.PSConfig + + + + + Left + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Key + + + Left + Value + + + Left + AppliesTo + + + Left + Scope + + + Left + HelpMessage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.generated.format.ps1xml b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.generated.format.ps1xml new file mode 100644 index 000000000000..8271581789c7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.generated.format.ps1xml @@ -0,0 +1,471 @@ + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + ResourceManagerUrl + + + Left + ActiveDirectoryAuthority + + + Left + Type + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Id + + + Left + TenantId + + + Left + State + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + $_.Context.Account.ToString() + + + Left + $_.Context.Subscription.Name + + + Left + $_.Context.Tenant.ToString() + + + Left + $_.Context.Environment.ToString() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + 40 + Left + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Account + + + Left + $_.Subscription.Name + + + Left + Environment + + + Left + $_.Tenant.ToString() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Id + + + Left + $_.Name + + + Left + $_.TenantCategory + + + Left + $_.Domains + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.types.ps1xml b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.types.ps1xml new file mode 100644 index 000000000000..2873f28fd663 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.types.ps1xml @@ -0,0 +1,306 @@ + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Core.AuthenticationStoreTokenCache + + + PSStandardMembers + + + SerializationMethod + SpecificProperties + + + PropertySerializationSet + + CacheData + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Core.ProtectedFileTokenCache + + + PSStandardMembers + + + SerializationMethod + SpecificProperties + + + PropertySerializationSet + + CacheData + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + Microsoft.Azure.Commands.Profile.Models.AzureContextConverter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.nuspec b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.nuspec new file mode 100644 index 000000000000..c7025c12758f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.nuspec @@ -0,0 +1,19 @@ + + + + Az.Accounts + 2.13.1 + Microsoft Corporation + Microsoft Corporation + true + https://aka.ms/azps-license + https://github.com/Azure/azure-powershell + Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://learn.microsoft.com/powershell/azure/authenticate-azureps + * Added the module name in breaking change messages +* Upgraded Microsoft.ApplicationInsights version from 2.13.1 to 2.18.0 + Microsoft Corporation. All rights reserved. + Azure ResourceManager ARM Accounts Authentication Environment Subscription PSModule PSIncludes_Cmdlet PSCmdlet_Disable-AzDataCollection PSCmdlet_Disable-AzContextAutosave PSCmdlet_Enable-AzDataCollection PSCmdlet_Enable-AzContextAutosave PSCmdlet_Remove-AzEnvironment PSCmdlet_Get-AzEnvironment PSCmdlet_Set-AzEnvironment PSCmdlet_Add-AzEnvironment PSCmdlet_Get-AzSubscription PSCmdlet_Connect-AzAccount PSCmdlet_Get-AzContext PSCmdlet_Set-AzContext PSCmdlet_Import-AzContext PSCmdlet_Save-AzContext PSCmdlet_Get-AzTenant PSCmdlet_Send-Feedback PSCmdlet_Resolve-AzError PSCmdlet_Select-AzContext PSCmdlet_Rename-AzContext PSCmdlet_Remove-AzContext PSCmdlet_Clear-AzContext PSCmdlet_Disconnect-AzAccount PSCmdlet_Get-AzContextAutosaveSetting PSCmdlet_Set-AzDefault PSCmdlet_Get-AzDefault PSCmdlet_Clear-AzDefault PSCmdlet_Register-AzModule PSCmdlet_Enable-AzureRmAlias PSCmdlet_Disable-AzureRmAlias PSCmdlet_Uninstall-AzureRm PSCmdlet_Invoke-AzRestMethod PSCmdlet_Get-AzAccessToken PSCmdlet_Open-AzSurveyLink PSCmdlet_Get-AzConfig PSCmdlet_Update-AzConfig PSCmdlet_Clear-AzConfig PSCmdlet_Export-AzConfig PSCmdlet_Import-AzConfig PSCommand_Disable-AzDataCollection PSCommand_Disable-AzContextAutosave PSCommand_Enable-AzDataCollection PSCommand_Enable-AzContextAutosave PSCommand_Remove-AzEnvironment PSCommand_Get-AzEnvironment PSCommand_Set-AzEnvironment PSCommand_Add-AzEnvironment PSCommand_Get-AzSubscription PSCommand_Connect-AzAccount PSCommand_Get-AzContext PSCommand_Set-AzContext PSCommand_Import-AzContext PSCommand_Save-AzContext PSCommand_Get-AzTenant PSCommand_Send-Feedback PSCommand_Resolve-AzError PSCommand_Select-AzContext PSCommand_Rename-AzContext PSCommand_Remove-AzContext PSCommand_Clear-AzContext PSCommand_Disconnect-AzAccount PSCommand_Get-AzContextAutosaveSetting PSCommand_Set-AzDefault PSCommand_Get-AzDefault PSCommand_Clear-AzDefault PSCommand_Register-AzModule PSCommand_Enable-AzureRmAlias PSCommand_Disable-AzureRmAlias PSCommand_Uninstall-AzureRm PSCommand_Invoke-AzRestMethod PSCommand_Get-AzAccessToken PSCommand_Open-AzSurveyLink PSCommand_Get-AzConfig PSCommand_Update-AzConfig PSCommand_Clear-AzConfig PSCommand_Export-AzConfig PSCommand_Import-AzConfig PSCommand_Add-AzAccount PSCommand_Login-AzAccount PSCommand_Remove-AzAccount PSCommand_Logout-AzAccount PSCommand_Select-AzSubscription PSCommand_Resolve-Error PSCommand_Save-AzProfile PSCommand_Get-AzDomain PSCommand_Invoke-AzRest PSCommand_Set-AzConfig + + \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psd1 b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psd1 new file mode 100644 index 000000000000..8b322becabf0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psd1 @@ -0,0 +1,389 @@ +# +# Module manifest for module 'Az.Accounts' +# +# Generated by: Microsoft Corporation +# +# Generated on: 9/20/2023 +# + +@{ + +# Script module or binary module file associated with this manifest. +RootModule = 'Az.Accounts.psm1' + +# Version number of this module. +ModuleVersion = '2.13.1' + +# Supported PSEditions +CompatiblePSEditions = 'Core', 'Desktop' + +# ID used to uniquely identify this module +GUID = '17a2feff-488b-47f9-8729-e2cec094624c' + +# Author of this module +Author = 'Microsoft Corporation' + +# Company or vendor of this module +CompanyName = 'Microsoft Corporation' + +# Copyright statement for this module +Copyright = 'Microsoft Corporation. All rights reserved.' + +# Description of the functionality provided by this module +Description = 'Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://learn.microsoft.com/powershell/azure/authenticate-azureps' + +# Minimum version of the PowerShell engine required by this module +PowerShellVersion = '5.1' + +# Name of the PowerShell host required by this module +# PowerShellHostName = '' + +# Minimum version of the PowerShell host required by this module +# PowerShellHostVersion = '' + +# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +DotNetFrameworkVersion = '4.7.2' + +# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +# ClrVersion = '' + +# Processor architecture (None, X86, Amd64) required by this module +# ProcessorArchitecture = '' + +# Modules that must be imported into the global environment prior to importing this module +# RequiredModules = @() + +# Assemblies that must be loaded prior to importing this module +RequiredAssemblies = 'Microsoft.Azure.PowerShell.AssemblyLoading.dll', + 'Microsoft.Azure.PowerShell.Authentication.Abstractions.dll', + 'Microsoft.Azure.PowerShell.Authentication.dll', + 'Microsoft.Azure.PowerShell.Authenticators.dll', + 'Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll', + 'Microsoft.Azure.PowerShell.Clients.Authorization.dll', + 'Microsoft.Azure.PowerShell.Clients.Compute.dll', + 'Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll', + 'Microsoft.Azure.PowerShell.Clients.Monitor.dll', + 'Microsoft.Azure.PowerShell.Clients.Network.dll', + 'Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll', + 'Microsoft.Azure.PowerShell.Clients.ResourceManager.dll', + 'Microsoft.Azure.PowerShell.Common.dll', + 'Microsoft.Azure.PowerShell.Storage.dll', + 'Microsoft.Azure.PowerShell.Clients.Storage.Management.dll', + 'Microsoft.Azure.PowerShell.Clients.KeyVault.dll', + 'Microsoft.Azure.PowerShell.Clients.Websites.dll', + 'Hyak.Common.dll', 'Microsoft.ApplicationInsights.dll', + 'Microsoft.Azure.Common.dll', 'Microsoft.Rest.ClientRuntime.dll', + 'Microsoft.Rest.ClientRuntime.Azure.dll', + 'Microsoft.WindowsAzure.Storage.dll', + 'Microsoft.WindowsAzure.Storage.DataMovement.dll', + 'Microsoft.Azure.PowerShell.Clients.Aks.dll', + 'Microsoft.Azure.PowerShell.Strategies.dll', + 'Microsoft.Azure.PowerShell.Common.Share.dll', 'FuzzySharp.dll' + +# Script files (.ps1) that are run in the caller's environment prior to importing this module. +# ScriptsToProcess = @() + +# Type files (.ps1xml) to be loaded when importing this module +# TypesToProcess = @() + +# Format files (.ps1xml) to be loaded when importing this module +FormatsToProcess = 'Accounts.format.ps1xml', 'Accounts.generated.format.ps1xml' + +# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess +NestedModules = @() + +# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. +FunctionsToExport = @() + +# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. +CmdletsToExport = 'Disable-AzDataCollection', 'Disable-AzContextAutosave', + 'Enable-AzDataCollection', 'Enable-AzContextAutosave', + 'Remove-AzEnvironment', 'Get-AzEnvironment', 'Set-AzEnvironment', + 'Add-AzEnvironment', 'Get-AzSubscription', 'Connect-AzAccount', + 'Get-AzContext', 'Set-AzContext', 'Import-AzContext', 'Save-AzContext', + 'Get-AzTenant', 'Send-Feedback', 'Resolve-AzError', 'Select-AzContext', + 'Rename-AzContext', 'Remove-AzContext', 'Clear-AzContext', + 'Disconnect-AzAccount', 'Get-AzContextAutosaveSetting', + 'Set-AzDefault', 'Get-AzDefault', 'Clear-AzDefault', + 'Register-AzModule', 'Enable-AzureRmAlias', 'Disable-AzureRmAlias', + 'Uninstall-AzureRm', 'Invoke-AzRestMethod', 'Get-AzAccessToken', + 'Open-AzSurveyLink', 'Get-AzConfig', 'Update-AzConfig', + 'Clear-AzConfig', 'Export-AzConfig', 'Import-AzConfig' + +# Variables to export from this module +# VariablesToExport = @() + +# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. +AliasesToExport = 'Add-AzAccount', 'Login-AzAccount', 'Remove-AzAccount', + 'Logout-AzAccount', 'Select-AzSubscription', 'Resolve-Error', + 'Save-AzProfile', 'Get-AzDomain', 'Invoke-AzRest', 'Set-AzConfig' + +# DSC resources to export from this module +# DscResourcesToExport = @() + +# List of all modules packaged with this module +# ModuleList = @() + +# List of all files packaged with this module +# FileList = @() + +# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. +PrivateData = @{ + + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + Tags = 'Azure','ResourceManager','ARM','Accounts','Authentication','Environment','Subscription' + + # A URL to the license for this module. + LicenseUri = 'https://aka.ms/azps-license' + + # A URL to the main website for this project. + ProjectUri = 'https://github.com/Azure/azure-powershell' + + # A URL to an icon representing this module. + # IconUri = '' + + # ReleaseNotes of this module + ReleaseNotes = '* Added the module name in breaking change messages +* Upgraded Microsoft.ApplicationInsights version from 2.13.1 to 2.18.0 ' + + # Prerelease string of this module + # Prerelease = '' + + # Flag to indicate whether the module requires explicit user acceptance for install/update/save + # RequireLicenseAcceptance = $false + + # External dependent modules of this module + # ExternalModuleDependencies = @() + + } # End of PSData hashtable + + } # End of PrivateData hashtable + +# HelpInfo URI of this module +# HelpInfoURI = '' + +# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. +# DefaultCommandPrefix = '' + +} + + +# SIG # Begin signature block +# MIIn0QYJKoZIhvcNAQcCoIInwjCCJ74CAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAk2HPcwhsJ45gq +# tueQH3lZy0qaJUF7KlbsF568k8m1kaCCDYUwggYDMIID66ADAgECAhMzAAADTU6R +# phoosHiPAAAAAANNMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI4WhcNMjQwMzE0MTg0MzI4WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDUKPcKGVa6cboGQU03ONbUKyl4WpH6Q2Xo9cP3RhXTOa6C6THltd2RfnjlUQG+ +# Mwoy93iGmGKEMF/jyO2XdiwMP427j90C/PMY/d5vY31sx+udtbif7GCJ7jJ1vLzd +# j28zV4r0FGG6yEv+tUNelTIsFmmSb0FUiJtU4r5sfCThvg8dI/F9Hh6xMZoVti+k +# bVla+hlG8bf4s00VTw4uAZhjGTFCYFRytKJ3/mteg2qnwvHDOgV7QSdV5dWdd0+x +# zcuG0qgd3oCCAjH8ZmjmowkHUe4dUmbcZfXsgWlOfc6DG7JS+DeJak1DvabamYqH +# g1AUeZ0+skpkwrKwXTFwBRltAgMBAAGjggGCMIIBfjAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUId2Img2Sp05U6XI04jli2KohL+8w +# VAYDVR0RBE0wS6RJMEcxLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEWMBQGA1UEBRMNMjMwMDEyKzUwMDUxNzAfBgNVHSMEGDAW +# gBRIbmTlUAXTgqoXNzcitW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8v +# d3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIw +# MTEtMDctMDguY3JsMGEGCCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDov +# L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDEx +# XzIwMTEtMDctMDguY3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIB +# ACMET8WuzLrDwexuTUZe9v2xrW8WGUPRQVmyJ1b/BzKYBZ5aU4Qvh5LzZe9jOExD +# YUlKb/Y73lqIIfUcEO/6W3b+7t1P9m9M1xPrZv5cfnSCguooPDq4rQe/iCdNDwHT +# 6XYW6yetxTJMOo4tUDbSS0YiZr7Mab2wkjgNFa0jRFheS9daTS1oJ/z5bNlGinxq +# 2v8azSP/GcH/t8eTrHQfcax3WbPELoGHIbryrSUaOCphsnCNUqUN5FbEMlat5MuY +# 94rGMJnq1IEd6S8ngK6C8E9SWpGEO3NDa0NlAViorpGfI0NYIbdynyOB846aWAjN +# fgThIcdzdWFvAl/6ktWXLETn8u/lYQyWGmul3yz+w06puIPD9p4KPiWBkCesKDHv +# XLrT3BbLZ8dKqSOV8DtzLFAfc9qAsNiG8EoathluJBsbyFbpebadKlErFidAX8KE +# usk8htHqiSkNxydamL/tKfx3V/vDAoQE59ysv4r3pE+zdyfMairvkFNNw7cPn1kH +# Gcww9dFSY2QwAxhMzmoM0G+M+YvBnBu5wjfxNrMRilRbxM6Cj9hKFh0YTwba6M7z +# ntHHpX3d+nabjFm/TnMRROOgIXJzYbzKKaO2g1kWeyG2QtvIR147zlrbQD4X10Ab +# rRg9CpwW7xYxywezj+iNAc+QmFzR94dzJkEPUSCJPsTFMIIHejCCBWKgAwIBAgIK +# YQ6Q0gAAAAAAAzANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlm +# aWNhdGUgQXV0aG9yaXR5IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEw +# OTA5WjB+MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYD +# VQQDEx9NaWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG +# 9w0BAQEFAAOCAg8AMIICCgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+la +# UKq4BjgaBEm6f8MMHt03a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc +# 6Whe0t+bU7IKLMOv2akrrnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4D +# dato88tt8zpcoRb0RrrgOGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+ +# lD3v++MrWhAfTVYoonpy4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nk +# kDstrjNYxbc+/jLTswM9sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6 +# A4aN91/w0FK/jJSHvMAhdCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmd +# X4jiJV3TIUs+UsS1Vz8kA/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL +# 5zmhD+kjSbwYuER8ReTBw3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zd +# sGbiwZeBe+3W7UvnSSmnEyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3 +# T8HhhUSJxAlMxdSlQy90lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS +# 4NaIjAsCAwEAAaOCAe0wggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRI +# bmTlUAXTgqoXNzcitW2oynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTAL +# BgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBD +# uRQFTuHqp8cx0SOJNDBaBgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jv +# c29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3JsMF4GCCsGAQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3J0MIGfBgNVHSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEF +# BQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1h +# cnljcHMuaHRtMEAGCCsGAQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkA +# YwB5AF8AcwB0AGEAdABlAG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn +# 8oalmOBUeRou09h0ZyKbC5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7 +# v0epo/Np22O/IjWll11lhJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0b +# pdS1HXeUOeLpZMlEPXh6I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/ +# KmtYSWMfCWluWpiW5IP0wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvy +# CInWH8MyGOLwxS3OW560STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBp +# mLJZiWhub6e3dMNABQamASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJi +# hsMdYzaXht/a8/jyFqGaJ+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYb +# BL7fQccOKO7eZS/sl/ahXJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbS +# oqKfenoi+kiVH6v7RyOA9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sL +# gOppO6/8MO0ETI7f33VtY5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtX +# cVZOSEXAQsmbdlsKgEhr/Xmfwb1tbWrJUnMTDXpQzTGCGaIwghmeAgEBMIGVMH4x +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01p +# Y3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTECEzMAAANNTpGmGiiweI8AAAAA +# A00wDQYJYIZIAWUDBAIBBQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQw +# HAYKKwYBBAGCNwIBCzEOMAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIPqM +# nLtedTpCCZWzygnrN5qjriZa3nvW0MEUhgHrBf/kMEIGCisGAQQBgjcCAQwxNDAy +# oBSAEgBNAGkAYwByAG8AcwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20wDQYJKoZIhvcNAQEBBQAEggEAS7p4ZPALh+4+yJuTQhIPP+LV4A+Jom3lI5qs +# lp7zGTEfbcL8TMbAGgLGl186yuYk/eJlpkSh/cGFRhbcBzQUgXmUfAGnRYugqMXE +# VvX3Qil+ivulxYqiozTr9zWcJ3vitlWIAFJqTTmdHjP0smU7TqrS66Tk06fR4sXU +# x5BVXrlrIismo9vw+sA7wI8LHKwTB61N+w9w2QRDXotckocOV5R/T6ySpCkJfjiP +# V/Ht7VO4JbhDXBedTy9uZ6yQdaBJgmF21iJxacaeYL+StSI/OaHApGTHpJo0/l8K +# UzZmO3S3+sUX3NwAyZ6A4iTM3dGMPFTiEykJD41kS/eAZgy+TaGCFywwghcoBgor +# BgEEAYI3AwMBMYIXGDCCFxQGCSqGSIb3DQEHAqCCFwUwghcBAgEDMQ8wDQYJYIZI +# AWUDBAIBBQAwggFZBgsqhkiG9w0BCRABBKCCAUgEggFEMIIBQAIBAQYKKwYBBAGE +# WQoDATAxMA0GCWCGSAFlAwQCAQUABCDzkxGA6Q74EKQNCUJRJIpLLx9SAzmpu+DM +# Ytnz01KnYQIGZN5VuexfGBMyMDIzMDkyMDA2MzM0Ni4wMjVaMASAAgH0oIHYpIHV +# MIHSMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH +# UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQL +# EyRNaWNyb3NvZnQgSXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsT +# HVRoYWxlcyBUU1MgRVNOOjA4NDItNEJFNi1DMjlBMSUwIwYDVQQDExxNaWNyb3Nv +# ZnQgVGltZS1TdGFtcCBTZXJ2aWNloIIRezCCBycwggUPoAMCAQICEzMAAAGybkAD +# f26plJIAAQAAAbIwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAg +# UENBIDIwMTAwHhcNMjIwOTIwMjAyMjAxWhcNMjMxMjE0MjAyMjAxWjCB0jELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9z +# b2Z0IElyZWxhbmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFsZXMg +# VFNTIEVTTjowODQyLTRCRTYtQzI5QTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUt +# U3RhbXAgU2VydmljZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMqi +# ZTIde/lQ4rC+Bml5f/Wuq/xKTxrfbG23HofmQ+qZAN4GyO73PF3y9OAfpt7Qf2jc +# ldWOGUB+HzBuwllYyP3fx4MY8zvuAuB37FvoytnNC2DKnVrVlHOVcGUL9CnmhDNM +# A2/nskjIf2IoiG9J0qLYr8duvHdQJ9Li2Pq9guySb9mvUL60ogslCO9gkh6FiEDw +# MrwUr8Wja6jFpUTny8tg0N0cnCN2w4fKkp5qZcbUYFYicLSb/6A7pHCtX6xnjqwh +# mJoib3vkKJyVxbuFLRhVXxH95b0LHeNhifn3jvo2j+/4QV10jEpXVW+iC9BsTtR6 +# 9xvTjU51ZgP7BR4YDEWq7JsylSOv5B5THTDXRf184URzFhTyb8OZQKY7mqMh7c8J +# 8w1sEM4XDUF2UZNy829NVCzG2tfdEXZaHxF8RmxpQYBxyhZwY1rotuIS+gfN2eq+ +# hkAT3ipGn8/KmDwDtzAbnfuXjApgeZqwgcYJ8pDJ+y/xU6ouzJz1Bve5TTihkiA7 +# wQsQe6R60Zk9dPdNzw0MK5niRzuQZAt4GI96FhjhlUWcUZOCkv/JXM/OGu/rgSpl +# YwdmPLzzfDtXyuy/GCU5I4l08g6iifXypMgoYkkceOAAz4vx1x0BOnZWfI3fSwqN +# UvoN7ncTT+MB4Vpvf1QBppjBAQUuvui6eCG0MCVNAgMBAAGjggFJMIIBRTAdBgNV +# HQ4EFgQUmfIngFzZEZlPkjDOVluBSDDaanEwHwYDVR0jBBgwFoAUn6cVXQBeYl2D +# 9OXSZacbUzUZ6XIwXwYDVR0fBFgwVjBUoFKgUIZOaHR0cDovL3d3dy5taWNyb3Nv +# ZnQuY29tL3BraW9wcy9jcmwvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUy +# MDIwMTAoMSkuY3JsMGwGCCsGAQUFBwEBBGAwXjBcBggrBgEFBQcwAoZQaHR0cDov +# L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNyb3NvZnQlMjBUaW1l +# LVN0YW1wJTIwUENBJTIwMjAxMCgxKS5jcnQwDAYDVR0TAQH/BAIwADAWBgNVHSUB +# Af8EDDAKBggrBgEFBQcDCDAOBgNVHQ8BAf8EBAMCB4AwDQYJKoZIhvcNAQELBQAD +# ggIBANxHtu3FzIabaDbWqswdKBlAhKXRCN+5CSMiv2TYa4i2QuWIm+99piwAhDhA +# Dfbqor1zyLi95Y6GQnvIWUgdeC7oL1ZtZye92zYK+EIfwYZmhS+CH4infAzUvscH +# ZF3wlrJUfPUIDGVP0lCYVse9mguvG0dqkY4ayQPEHOvJubgZZaOdg/N8dInd6fGe +# Oc+0DoGzB+LieObJ2Q0AtEt3XN3iX8Cp6+dZTX8xwE/LvhRwPpb/+nKshO7TVuve +# nwdTwqB/LT6CNPaElwFeKxKrqRTPMbHeg+i+KnBLfwmhEXsMg2s1QX7JIxfvT96m +# d0eiMjiMEO22LbOzmLMNd3LINowAnRBAJtX+3/e390B9sMGMHp+a1V+hgs62AopB +# l0p/00li30DN5wEQ5If35Zk7b/T6pEx6rJUDYCti7zCbikjKTanBnOc99zGMlej5 +# X+fC/k5ExUCrOs3/VzGRCZt5LvVQSdWqq/QMzTEmim4sbzASK9imEkjNtZZyvC1C +# sUcD1voFktld4mKMjE+uDEV3IddD+DrRk94nVzNPSuZXewfVOnXHSeqG7xM3V7fl +# 2aL4v1OhL2+JwO1Tx3B0irO1O9qbNdJk355bntd1RSVKgM22KFBHnoL7Js7pRhBi +# aKmVTQGoOb+j1Qa7q+cixGo48Vh9k35BDsJS/DLoXFSPDl4mMIIHcTCCBVmgAwIB +# AgITMwAAABXF52ueAptJmQAAAAAAFTANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UE +# BhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAc +# BgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0 +# IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTAwHhcNMjEwOTMwMTgyMjI1 +# WhcNMzAwOTMwMTgzMjI1WjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu +# Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv +# cmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDCC +# AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAOThpkzntHIhC3miy9ckeb0O +# 1YLT/e6cBwfSqWxOdcjKNVf2AX9sSuDivbk+F2Az/1xPx2b3lVNxWuJ+Slr+uDZn +# hUYjDLWNE893MsAQGOhgfWpSg0S3po5GawcU88V29YZQ3MFEyHFcUTE3oAo4bo3t +# 1w/YJlN8OWECesSq/XJprx2rrPY2vjUmZNqYO7oaezOtgFt+jBAcnVL+tuhiJdxq +# D89d9P6OU8/W7IVWTe/dvI2k45GPsjksUZzpcGkNyjYtcI4xyDUoveO0hyTD4MmP +# frVUj9z6BVWYbWg7mka97aSueik3rMvrg0XnRm7KMtXAhjBcTyziYrLNueKNiOSW +# rAFKu75xqRdbZ2De+JKRHh09/SDPc31BmkZ1zcRfNN0Sidb9pSB9fvzZnkXftnIv +# 231fgLrbqn427DZM9ituqBJR6L8FA6PRc6ZNN3SUHDSCD/AQ8rdHGO2n6Jl8P0zb +# r17C89XYcz1DTsEzOUyOArxCaC4Q6oRRRuLRvWoYWmEBc8pnol7XKHYC4jMYcten +# IPDC+hIK12NvDMk2ZItboKaDIV1fMHSRlJTYuVD5C4lh8zYGNRiER9vcG9H9stQc +# xWv2XFJRXRLbJbqvUAV6bMURHXLvjflSxIUXk8A8FdsaN8cIFRg/eKtFtvUeh17a +# j54WcmnGrnu3tz5q4i6tAgMBAAGjggHdMIIB2TASBgkrBgEEAYI3FQEEBQIDAQAB +# MCMGCSsGAQQBgjcVAgQWBBQqp1L+ZMSavoKRPEY1Kc8Q/y8E7jAdBgNVHQ4EFgQU +# n6cVXQBeYl2D9OXSZacbUzUZ6XIwXAYDVR0gBFUwUzBRBgwrBgEEAYI3TIN9AQEw +# QTA/BggrBgEFBQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9E +# b2NzL1JlcG9zaXRvcnkuaHRtMBMGA1UdJQQMMAoGCCsGAQUFBwMIMBkGCSsGAQQB +# gjcUAgQMHgoAUwB1AGIAQwBBMAsGA1UdDwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/ +# MB8GA1UdIwQYMBaAFNX2VsuP6KJcYmjRPZSQW9fOmhjEMFYGA1UdHwRPME0wS6BJ +# oEeGRWh0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01p +# Y1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNybDBaBggrBgEFBQcBAQROMEwwSgYIKwYB +# BQUHMAKGPmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2kvY2VydHMvTWljUm9v +# Q2VyQXV0XzIwMTAtMDYtMjMuY3J0MA0GCSqGSIb3DQEBCwUAA4ICAQCdVX38Kq3h +# LB9nATEkW+Geckv8qW/qXBS2Pk5HZHixBpOXPTEztTnXwnE2P9pkbHzQdTltuw8x +# 5MKP+2zRoZQYIu7pZmc6U03dmLq2HnjYNi6cqYJWAAOwBb6J6Gngugnue99qb74p +# y27YP0h1AdkY3m2CDPVtI1TkeFN1JFe53Z/zjj3G82jfZfakVqr3lbYoVSfQJL1A +# oL8ZthISEV09J+BAljis9/kpicO8F7BUhUKz/AyeixmJ5/ALaoHCgRlCGVJ1ijbC +# HcNhcy4sa3tuPywJeBTpkbKpW99Jo3QMvOyRgNI95ko+ZjtPu4b6MhrZlvSP9pEB +# 9s7GdP32THJvEKt1MMU0sHrYUP4KWN1APMdUbZ1jdEgssU5HLcEUBHG/ZPkkvnNt +# yo4JvbMBV0lUZNlz138eW0QBjloZkWsNn6Qo3GcZKCS6OEuabvshVGtqRRFHqfG3 +# rsjoiV5PndLQTHa1V1QJsWkBRH58oWFsc/4Ku+xBZj1p/cvBQUl+fpO+y/g75LcV +# v7TOPqUxUYS8vwLBgqJ7Fx0ViY1w/ue10CgaiQuPNtq6TPmb/wrpNPgkNWcr4A24 +# 5oyZ1uEi6vAnQj0llOZ0dFtq0Z4+7X6gMTN9vMvpe784cETRkPHIqzqKOghif9lw +# Y1NNje6CbaUFEMFxBmoQtB1VM1izoXBm8qGCAtcwggJAAgEBMIIBAKGB2KSB1TCB +# 0jELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1Jl +# ZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMk +# TWljcm9zb2Z0IElyZWxhbmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1U +# aGFsZXMgVFNTIEVTTjowODQyLTRCRTYtQzI5QTElMCMGA1UEAxMcTWljcm9zb2Z0 +# IFRpbWUtU3RhbXAgU2VydmljZaIjCgEBMAcGBSsOAwIaAxUAjhJ+EeySRfn2KCNs +# jn9cF9AUSTqggYMwgYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu +# Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv +# cmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDAN +# BgkqhkiG9w0BAQUFAAIFAOi0+i0wIhgPMjAyMzA5MjAxMjU3MTdaGA8yMDIzMDky +# MTEyNTcxN1owdzA9BgorBgEEAYRZCgQBMS8wLTAKAgUA6LT6LQIBADAKAgEAAgIR +# nAIB/zAHAgEAAgIR0DAKAgUA6LZLrQIBADA2BgorBgEEAYRZCgQCMSgwJjAMBgor +# BgEEAYRZCgMCoAowCAIBAAIDB6EgoQowCAIBAAIDAYagMA0GCSqGSIb3DQEBBQUA +# A4GBAGjRjrn62VuBz/kNRF8KdoG4YOpoAZu0e3XBc+tcCCiG1Je/ZYXUzMrrq/cz +# MFXWzdmSQRBFPRvcFJw8LcTRu4C6eQOJywts4MMoyE3nJOUUUsOB/i2h2w7L/fo0 +# 3EeEXVTQn/aSK7jkMyysxQEWOw64WNG06Sd08ZDadqbnAc7zMYIEDTCCBAkCAQEw +# gZMwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT +# B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UE +# AxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAGybkADf26plJIA +# AQAAAbIwDQYJYIZIAWUDBAIBBQCgggFKMBoGCSqGSIb3DQEJAzENBgsqhkiG9w0B +# CRABBDAvBgkqhkiG9w0BCQQxIgQgDd3716NLDTxGc+0tAskrKgBsB9PO5RK3smyU +# vyfE7/owgfoGCyqGSIb3DQEJEAIvMYHqMIHnMIHkMIG9BCBTeM485+E+t4PEVieU +# oFKX7PVyLo/nzu+htJPCG04+NTCBmDCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABsm5AA39uqZSSAAEAAAGyMCIEILLYuf/URU9tiFRXIhgo +# OAyZuYAFYpFAH2I0pLSN1lWkMA0GCSqGSIb3DQEBCwUABIICAMQZqLlhmv19+CcR +# claEHbZr4MgJjWr2Da27FqRgoOLDtNaS/IZ16UHukAV7JVdIOdVroxfvVdWXh5iq +# dSAfYNMkSBBPxxLbSFnndIw7KWkp3vbxFcJ6+JsK9k54TDZAUP17OpTM11gpTYfm +# uVAWZaqh086moHKLZsjVU/rzFA3En+QY5ZticB0LytwkIY+7pS6ikN4Q3e/pzPLH +# CSa2OZN3bXezZzOWMFLQwJ2IQJLpCKs0RiICTOaOKTpsjcoK2eBLwzXsgnnNZmj/ +# q1XMWGUJbnNJH4mszFVJ6X0cUo3OJvkF9V796VoZZMUS9i0EmCUZNE0rcvPdBnIE +# c8P+QSbLudmDA+XXno2ItqeA1ZkatNLyZGYGSjK4BU48MzcHMkWKCcUlqyfUiJt7 +# 7UGXDTuCzVkqCVVo7XpJNbN7X1oLkh8yTPr5RBbmlzzykIfEkoVnYj4Qc89ohb1N +# qXKDWby0ldBFOZIgyOgRiYJ984yyeAAXvOpTexhDtDCguYGfV56U+NTMve18Oa8u +# IODMD1Nfr+JLHL+J2tkMfZGFa71tGGnI2w9W6xUltjs8XINLrF08szKC6Vlo20wl +# F09Em/cF6qbZ2cnC/BDOt3xDDnJHYOHLR9QCZABbMd7JiuH32PE5C79PbpPYzyje +# p0LB6iM1n1UYaSSFWCx/a3Itdf6/ +# SIG # End signature block diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psm1 b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psm1 new file mode 100644 index 000000000000..2022fcfde49d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psm1 @@ -0,0 +1,365 @@ +# +# Script module for module 'Az.Accounts' that is executed when 'Az.Accounts' is imported in a PowerShell session. +# +# Generated by: Microsoft Corporation +# +# Generated on: 09/20/2023 05:38:15 +# + +$PSDefaultParameterValues.Clear() +Set-StrictMode -Version Latest + +function Test-DotNet +{ + try + { + if ((Get-PSDrive 'HKLM' -ErrorAction Ignore) -and (-not (Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\' -ErrorAction Stop | Get-ItemPropertyValue -ErrorAction Stop -Name Release | Where-Object { $_ -ge 461808 }))) + { + throw ".NET Framework versions lower than 4.7.2 are not supported in Az. Please upgrade to .NET Framework 4.7.2 or higher." + } + } + catch [System.Management.Automation.DriveNotFoundException] + { + Write-Verbose ".NET Framework version check failed." + } +} + +function Preload-Assembly { + param ( + [string] + $AssemblyDirectory + ) + if($PSEdition -eq 'Desktop' -and (Test-Path $AssemblyDirectory -ErrorAction Ignore)) + { + try + { + Get-ChildItem -ErrorAction Stop -Path $AssemblyDirectory -Filter "*.dll" | ForEach-Object { + try + { + Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null + } + catch { + Write-Verbose $_ + } + } + } + catch {} + } +} + +if ($true -and ($PSEdition -eq 'Desktop')) +{ + if ($PSVersionTable.PSVersion -lt [Version]'5.1') + { + throw "PowerShell versions lower than 5.1 are not supported in Az. Please upgrade to PowerShell 5.1 or higher." + } + + Test-DotNet +} + +if ($true -and ($PSEdition -eq 'Core')) +{ + if ($PSVersionTable.PSVersion -lt [Version]'6.2.4') + { + throw "Current Az version doesn't support PowerShell Core versions lower than 6.2.4. Please upgrade to PowerShell Core 6.2.4 or higher." + } + if ($PSVersionTable.PSVersion -lt [Version]'7.0.6') + { + Write-Warning "This version of Az.Accounts is only supported on Windows PowerShell 5.1 and PowerShell 7.0.6 or greater, open https://aka.ms/install-powershell to learn how to upgrade. For further information, go to https://aka.ms/azpslifecycle." + } +} + +if (Test-Path -Path "$PSScriptRoot\StartupScripts" -ErrorAction Ignore) +{ + Get-ChildItem "$PSScriptRoot\StartupScripts" -ErrorAction Stop | ForEach-Object { + . $_.FullName + } +} + +# [windows powershell] preload assemblies +if ($PSEdition -eq "Desktop") { + [Microsoft.Azure.PowerShell.AssemblyLoading.ConditionalAssemblyProvider]::GetAssemblies().Values | ForEach-Object { + $path = $_.Item1 + try { + Add-Type -Path $path -ErrorAction Ignore | Out-Null + } + catch { + Write-Verbose "Could not preload $path" + } + } +} + +# [windows powershell] preload module alc assemblies +$preloadPath = (Join-Path $PSScriptRoot -ChildPath "ModuleAlcAssemblies") +Preload-Assembly -AssemblyDirectory $preloadPath + +if (Get-Module AzureRM.profile -ErrorAction Ignore) +{ + Write-Warning ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") + throw ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") +} + +Import-Module (Join-Path -Path $PSScriptRoot -ChildPath Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll) + + +if (Test-Path -Path "$PSScriptRoot\PostImportScripts" -ErrorAction Ignore) +{ + Get-ChildItem "$PSScriptRoot\PostImportScripts" -ErrorAction Stop | ForEach-Object { + . $_.FullName + } +} + +$FilteredCommands = @() + +if ($Env:ACC_CLOUD -eq $null) +{ + $FilteredCommands | ForEach-Object { + + $existingDefault = $false + foreach ($key in $global:PSDefaultParameterValues.Keys) + { + if ($_ -like "$key") + { + $existingDefault = $true + } + } + + if (!$existingDefault) + { + $global:PSDefaultParameterValues.Add($_, + { + if ((Get-Command Get-AzContext -ErrorAction Ignore) -eq $null) + { + $context = Get-AzureRmContext + } + else + { + $context = Get-AzContext + } + if (($context -ne $null) -and $context.ExtendedProperties.ContainsKey("Default Resource Group")) { + $context.ExtendedProperties["Default Resource Group"] + } + }) + } + } +} + +[Microsoft.Azure.Commands.Profile.Utilities.CommandNotFoundHelper]::RegisterCommandNotFoundAction($ExecutionContext.InvokeCommand) + +# SIG # Begin signature block +# MIInwgYJKoZIhvcNAQcCoIInszCCJ68CAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCb9fJw7tRJSjyo +# JEg82Xj/MrcwppXsz44viAgrYDK20aCCDXYwggX0MIID3KADAgECAhMzAAADTrU8 +# esGEb+srAAAAAANOMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI5WhcNMjQwMzE0MTg0MzI5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDdCKiNI6IBFWuvJUmf6WdOJqZmIwYs5G7AJD5UbcL6tsC+EBPDbr36pFGo1bsU +# p53nRyFYnncoMg8FK0d8jLlw0lgexDDr7gicf2zOBFWqfv/nSLwzJFNP5W03DF/1 +# 1oZ12rSFqGlm+O46cRjTDFBpMRCZZGddZlRBjivby0eI1VgTD1TvAdfBYQe82fhm +# WQkYR/lWmAK+vW/1+bO7jHaxXTNCxLIBW07F8PBjUcwFxxyfbe2mHB4h1L4U0Ofa +# +HX/aREQ7SqYZz59sXM2ySOfvYyIjnqSO80NGBaz5DvzIG88J0+BNhOu2jl6Dfcq +# jYQs1H/PMSQIK6E7lXDXSpXzAgMBAAGjggFzMIIBbzAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUnMc7Zn/ukKBsBiWkwdNfsN5pdwAw +# RQYDVR0RBD4wPKQ6MDgxHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEW +# MBQGA1UEBRMNMjMwMDEyKzUwMDUxNjAfBgNVHSMEGDAWgBRIbmTlUAXTgqoXNzci +# tW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIwMTEtMDctMDguY3JsMGEG +# CCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDovL3d3dy5taWNyb3NvZnQu +# Y29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDExXzIwMTEtMDctMDguY3J0 +# MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIBAD21v9pHoLdBSNlFAjmk +# mx4XxOZAPsVxxXbDyQv1+kGDe9XpgBnT1lXnx7JDpFMKBwAyIwdInmvhK9pGBa31 +# TyeL3p7R2s0L8SABPPRJHAEk4NHpBXxHjm4TKjezAbSqqbgsy10Y7KApy+9UrKa2 +# kGmsuASsk95PVm5vem7OmTs42vm0BJUU+JPQLg8Y/sdj3TtSfLYYZAaJwTAIgi7d +# hzn5hatLo7Dhz+4T+MrFd+6LUa2U3zr97QwzDthx+RP9/RZnur4inzSQsG5DCVIM +# pA1l2NWEA3KAca0tI2l6hQNYsaKL1kefdfHCrPxEry8onJjyGGv9YKoLv6AOO7Oh +# JEmbQlz/xksYG2N/JSOJ+QqYpGTEuYFYVWain7He6jgb41JbpOGKDdE/b+V2q/gX +# UgFe2gdwTpCDsvh8SMRoq1/BNXcr7iTAU38Vgr83iVtPYmFhZOVM0ULp/kKTVoir +# IpP2KCxT4OekOctt8grYnhJ16QMjmMv5o53hjNFXOxigkQWYzUO+6w50g0FAeFa8 +# 5ugCCB6lXEk21FFB1FdIHpjSQf+LP/W2OV/HfhC3uTPgKbRtXo83TZYEudooyZ/A +# Vu08sibZ3MkGOJORLERNwKm2G7oqdOv4Qj8Z0JrGgMzj46NFKAxkLSpE5oHQYP1H +# tPx1lPfD7iNSbJsP6LiUHXH1MIIHejCCBWKgAwIBAgIKYQ6Q0gAAAAAAAzANBgkq +# hkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x +# EDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv +# bjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 +# IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEwOTA5WjB+MQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYDVQQDEx9NaWNyb3NvZnQg +# Q29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +# CgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+laUKq4BjgaBEm6f8MMHt03 +# a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc6Whe0t+bU7IKLMOv2akr +# rnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4Ddato88tt8zpcoRb0Rrrg +# OGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+lD3v++MrWhAfTVYoonpy +# 4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nkkDstrjNYxbc+/jLTswM9 +# sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6A4aN91/w0FK/jJSHvMAh +# dCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmdX4jiJV3TIUs+UsS1Vz8k +# A/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL5zmhD+kjSbwYuER8ReTB +# w3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zdsGbiwZeBe+3W7UvnSSmn +# Eyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3T8HhhUSJxAlMxdSlQy90 +# lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS4NaIjAsCAwEAAaOCAe0w +# ggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRIbmTlUAXTgqoXNzcitW2o +# ynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNVHQ8EBAMCAYYwDwYD +# VR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBDuRQFTuHqp8cx0SOJNDBa +# BgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpL2Ny +# bC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3JsMF4GCCsG +# AQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3J0MIGfBgNV +# HSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEFBQcCARYzaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1hcnljcHMuaHRtMEAGCCsG +# AQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkAYwB5AF8AcwB0AGEAdABl +# AG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn8oalmOBUeRou09h0ZyKb +# C5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7v0epo/Np22O/IjWll11l +# hJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0bpdS1HXeUOeLpZMlEPXh6 +# I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/KmtYSWMfCWluWpiW5IP0 +# wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvyCInWH8MyGOLwxS3OW560 +# STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBpmLJZiWhub6e3dMNABQam +# ASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJihsMdYzaXht/a8/jyFqGa +# J+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYbBL7fQccOKO7eZS/sl/ah +# XJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbSoqKfenoi+kiVH6v7RyOA +# 9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sLgOppO6/8MO0ETI7f33Vt +# Y5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtXcVZOSEXAQsmbdlsKgEhr +# /Xmfwb1tbWrJUnMTDXpQzTGCGaIwghmeAgEBMIGVMH4xCzAJBgNVBAYTAlVTMRMw +# EQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVN +# aWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNp +# Z25pbmcgUENBIDIwMTECEzMAAANOtTx6wYRv6ysAAAAAA04wDQYJYIZIAWUDBAIB +# BQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQwHAYKKwYBBAGCNwIBCzEO +# MAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIBsLZoT0GL3AfKW+v1FN9bVc +# VG31uoPh0H8hDfNXM1ivMEIGCisGAQQBgjcCAQwxNDAyoBSAEgBNAGkAYwByAG8A +# cwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20wDQYJKoZIhvcNAQEB +# BQAEggEAjm1RFaOR3jSivggTJhg8Xe4uZwJNAA0kGjYaTLK0sO7bf6gszj9yyZOW +# xl5OXc3I5e8idePoA9U2yMuNyGLP10P/SjCg/FSClm4PZr0HA1ORNDHn85kNLc+7 +# sQMWCkOiYLKNq/TudhmRGfeuEzjeZSiXKGbB65Fr5LeqGAuMNcZ5lKsP4Es7Cavs +# hG+lQd/27Lrb3xnB5LF5FZ9blmjY9UcS0hBnd6x/ynOB4WBFBjsu42fJZz2xx/04 +# panwkiuigz301YvY0maYIiNYJOWaNU32fVM+YX9b7+Iq5plTEx8XhWsexqmQTv9H +# jMkZa/2RkYvkbGfHQ3Ckw/oYI1NydKGCFywwghcoBgorBgEEAYI3AwMBMYIXGDCC +# FxQGCSqGSIb3DQEHAqCCFwUwghcBAgEDMQ8wDQYJYIZIAWUDBAIBBQAwggFZBgsq +# hkiG9w0BCRABBKCCAUgEggFEMIIBQAIBAQYKKwYBBAGEWQoDATAxMA0GCWCGSAFl +# AwQCAQUABCCehXSh9EH4ZOe8kqIKTs5kjZxVf/mTlUUsukZabtyKDwIGZN/OPZ5t +# GBMyMDIzMDkyMDA1NTAzNS4zNjZaMASAAgH0oIHYpIHVMIHSMQswCQYDVQQGEwJV +# UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UE +# ChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQLEyRNaWNyb3NvZnQgSXJl +# bGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1MgRVNO +# OkQwODItNEJGRC1FRUJBMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFtcCBT +# ZXJ2aWNloIIRezCCBycwggUPoAMCAQICEzMAAAG6Hz8Z98F1vXwAAQAAAbowDQYJ +# KoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x +# EDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv +# bjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwHhcNMjIw +# OTIwMjAyMjE5WhcNMjMxMjE0MjAyMjE5WjCB0jELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9zb2Z0IElyZWxhbmQgT3Bl +# cmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjpEMDgyLTRC +# RkQtRUVCQTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2VydmljZTCC +# AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAIhOFYMzkjWAE9UVnXF9hRGv +# 0xBRxc+I5Hu3hxVFXyK3u38xusEb0pLkwjgGtDsaLLbrlMxqX3tFb/3BgEPEC3L0 +# wX76gD8zHt+wiBV5mq5BWop29qRrgMJKKCPcpQnSjs9B/4XMFFvrpdPicZDv43FL +# gz9fHqMq0LJDw5JAHGDS30TCY9OF43P4d44Z9lE7CaVS2pJMF3L453MXB5yYK/KD +# bilhERP1jxn2yl+tGCRguIAsMG0oeOhXaw8uSGOhS6ACSHb+ebi0038MFHyoTNhK +# f+SYo4OpSY3xP4+swBBTKDoYP1wH+CfxG6h9fymBJQPQZaqfl0riiDLjmDunQtH1 +# GD64Air5k9Jdwhq5wLmSWXjyFVL+IDfOpdixJ6f5o+MhE6H4t31w+prygHmd2UHQ +# 657UGx6FNuzwC+SpAHmV76MZYac4uAhTgaP47P2eeS1ockvyhl9ya+9JzPfMkug3 +# xevzFADWiLRMr066EMV7q3JSRAsnCS9GQ08C4FKPbSh8OPM33Lng0ffxANnHAAX/ +# DE7cHcx7l9jaV3Acmkj7oqir4Eh2u5YxwiaTE37XaMumX2ES3PJ5NBaXq7YdLJwy +# SD+U9pk/tl4dQ1t/Eeo7uDTliOyQkD8I74xpVB0T31/67KHfkBkFVvy6wye21V+9 +# IC8uSD++RgD3RwtN2kE/AgMBAAGjggFJMIIBRTAdBgNVHQ4EFgQUimLm8QMeJa25 +# j9MWeabI2HSvZOUwHwYDVR0jBBgwFoAUn6cVXQBeYl2D9OXSZacbUzUZ6XIwXwYD +# VR0fBFgwVjBUoFKgUIZOaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9j +# cmwvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAoMSkuY3JsMGwG +# CCsGAQUFBwEBBGAwXjBcBggrBgEFBQcwAoZQaHR0cDovL3d3dy5taWNyb3NvZnQu +# Y29tL3BraW9wcy9jZXJ0cy9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENBJTIw +# MjAxMCgxKS5jcnQwDAYDVR0TAQH/BAIwADAWBgNVHSUBAf8EDDAKBggrBgEFBQcD +# CDAOBgNVHQ8BAf8EBAMCB4AwDQYJKoZIhvcNAQELBQADggIBAF/I8U6hbZhvDcn9 +# 6nZ6tkbSEjXPvKZ6wroaXcgstEhpgaeEwleLuPXHLzEWtuJuYz4eshmhXqFr49lb +# AcX5SN5/cEsP0xdFayb7U5P94JZd3HjFvpWRNoNBhF3SDM0A38sI2H+hjhB/VfX1 +# XcZiei1ROPAyCHcBgHLyQrEu6mnb3HhbIdr8h0Ta7WFylGhLSFW6wmzKusP6aOlm +# nGSac5NMfla6lRvTYHd28rbbCgfSm1RhTgoZj+W8DTKtiEMwubHJ3mIPKmo8xtJI +# WXPnXq6XKgldrL5cynLMX/0WX65OuWbHV5GTELdfWvGV3DaZrHPUQ/UP31Keqb2x +# jVCb30LVwgbjIvYS77N1dARkN8F/9pJ1gO4IvZWMwyMlKKFGojO1f1wbjSWcA/57 +# tsc+t2blrMWgSNHgzDr01jbPSupRjy3Ht9ZZs4xN02eiX3eG297NrtC6l4c/gzn2 +# 0eqoqWx/uHWxmTgB0F5osBuTHOe77DyEA0uhArGlgKP91jghgt/OVHoH65g0QqCt +# gZ+36mnCEg6IOhFoFrCc0fJFGVmb1+17gEe+HRMM7jBk4O06J+IooFrI3e3PJjPr +# Qano/MyE3h+zAuBWGMDRcUlNKCDU7dGnWvH3XWwLrCCIcz+3GwRUMsLsDdPW2OVv +# 7v1eEJiMSIZ2P+M7L20Q8aznU4OAMIIHcTCCBVmgAwIBAgITMwAAABXF52ueAptJ +# mQAAAAAAFTANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgT +# Cldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29m +# dCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNh +# dGUgQXV0aG9yaXR5IDIwMTAwHhcNMjEwOTMwMTgyMjI1WhcNMzAwOTMwMTgzMjI1 +# WjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH +# UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQD +# Ex1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDCCAiIwDQYJKoZIhvcNAQEB +# BQADggIPADCCAgoCggIBAOThpkzntHIhC3miy9ckeb0O1YLT/e6cBwfSqWxOdcjK +# NVf2AX9sSuDivbk+F2Az/1xPx2b3lVNxWuJ+Slr+uDZnhUYjDLWNE893MsAQGOhg +# fWpSg0S3po5GawcU88V29YZQ3MFEyHFcUTE3oAo4bo3t1w/YJlN8OWECesSq/XJp +# rx2rrPY2vjUmZNqYO7oaezOtgFt+jBAcnVL+tuhiJdxqD89d9P6OU8/W7IVWTe/d +# vI2k45GPsjksUZzpcGkNyjYtcI4xyDUoveO0hyTD4MmPfrVUj9z6BVWYbWg7mka9 +# 7aSueik3rMvrg0XnRm7KMtXAhjBcTyziYrLNueKNiOSWrAFKu75xqRdbZ2De+JKR +# Hh09/SDPc31BmkZ1zcRfNN0Sidb9pSB9fvzZnkXftnIv231fgLrbqn427DZM9itu +# qBJR6L8FA6PRc6ZNN3SUHDSCD/AQ8rdHGO2n6Jl8P0zbr17C89XYcz1DTsEzOUyO +# ArxCaC4Q6oRRRuLRvWoYWmEBc8pnol7XKHYC4jMYctenIPDC+hIK12NvDMk2ZItb +# oKaDIV1fMHSRlJTYuVD5C4lh8zYGNRiER9vcG9H9stQcxWv2XFJRXRLbJbqvUAV6 +# bMURHXLvjflSxIUXk8A8FdsaN8cIFRg/eKtFtvUeh17aj54WcmnGrnu3tz5q4i6t +# AgMBAAGjggHdMIIB2TASBgkrBgEEAYI3FQEEBQIDAQABMCMGCSsGAQQBgjcVAgQW +# BBQqp1L+ZMSavoKRPEY1Kc8Q/y8E7jAdBgNVHQ4EFgQUn6cVXQBeYl2D9OXSZacb +# UzUZ6XIwXAYDVR0gBFUwUzBRBgwrBgEEAYI3TIN9AQEwQTA/BggrBgEFBQcCARYz +# aHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9Eb2NzL1JlcG9zaXRvcnku +# aHRtMBMGA1UdJQQMMAoGCCsGAQUFBwMIMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIA +# QwBBMAsGA1UdDwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNX2 +# VsuP6KJcYmjRPZSQW9fOmhjEMFYGA1UdHwRPME0wS6BJoEeGRWh0dHA6Ly9jcmwu +# bWljcm9zb2Z0LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dF8yMDEw +# LTA2LTIzLmNybDBaBggrBgEFBQcBAQROMEwwSgYIKwYBBQUHMAKGPmh0dHA6Ly93 +# d3cubWljcm9zb2Z0LmNvbS9wa2kvY2VydHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYt +# MjMuY3J0MA0GCSqGSIb3DQEBCwUAA4ICAQCdVX38Kq3hLB9nATEkW+Geckv8qW/q +# XBS2Pk5HZHixBpOXPTEztTnXwnE2P9pkbHzQdTltuw8x5MKP+2zRoZQYIu7pZmc6 +# U03dmLq2HnjYNi6cqYJWAAOwBb6J6Gngugnue99qb74py27YP0h1AdkY3m2CDPVt +# I1TkeFN1JFe53Z/zjj3G82jfZfakVqr3lbYoVSfQJL1AoL8ZthISEV09J+BAljis +# 9/kpicO8F7BUhUKz/AyeixmJ5/ALaoHCgRlCGVJ1ijbCHcNhcy4sa3tuPywJeBTp +# kbKpW99Jo3QMvOyRgNI95ko+ZjtPu4b6MhrZlvSP9pEB9s7GdP32THJvEKt1MMU0 +# sHrYUP4KWN1APMdUbZ1jdEgssU5HLcEUBHG/ZPkkvnNtyo4JvbMBV0lUZNlz138e +# W0QBjloZkWsNn6Qo3GcZKCS6OEuabvshVGtqRRFHqfG3rsjoiV5PndLQTHa1V1QJ +# sWkBRH58oWFsc/4Ku+xBZj1p/cvBQUl+fpO+y/g75LcVv7TOPqUxUYS8vwLBgqJ7 +# Fx0ViY1w/ue10CgaiQuPNtq6TPmb/wrpNPgkNWcr4A245oyZ1uEi6vAnQj0llOZ0 +# dFtq0Z4+7X6gMTN9vMvpe784cETRkPHIqzqKOghif9lwY1NNje6CbaUFEMFxBmoQ +# tB1VM1izoXBm8qGCAtcwggJAAgEBMIIBAKGB2KSB1TCB0jELMAkGA1UEBhMCVVMx +# EzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoT +# FU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9zb2Z0IElyZWxh +# bmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjpE +# MDgyLTRCRkQtRUVCQTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2Vy +# dmljZaIjCgEBMAcGBSsOAwIaAxUAdqNHe113gCJ87aZIGa5QBUqIwvKggYMwgYCk +# fjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH +# UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQD +# Ex1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDANBgkqhkiG9w0BAQUFAAIF +# AOi0eZswIhgPMjAyMzA5MjAwMzQ4NDNaGA8yMDIzMDkyMTAzNDg0M1owdzA9Bgor +# BgEEAYRZCgQBMS8wLTAKAgUA6LR5mwIBADAKAgEAAgIL+AIB/zAHAgEAAgIULDAK +# AgUA6LXLGwIBADA2BgorBgEEAYRZCgQCMSgwJjAMBgorBgEEAYRZCgMCoAowCAIB +# AAIDB6EgoQowCAIBAAIDAYagMA0GCSqGSIb3DQEBBQUAA4GBAClyBBu79vwaDEgr +# sDdtLY+7se9ISbk8pveb65oGP9gabWe8mNnqfg1SxEN1eW2I4ihQvT2bQVBGeDi7 +# wVO+vcDBDl/uDAaYT7wKES/l/PJORKyBmUoDGFoLJT7bHa+uqFek2mjsC8RIlpdj +# oVOh5HQksZd5HgNF4K/uv2nUyKuEMYIEDTCCBAkCAQEwgZMwfDELMAkGA1UEBhMC +# VVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNV +# BAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRp +# bWUtU3RhbXAgUENBIDIwMTACEzMAAAG6Hz8Z98F1vXwAAQAAAbowDQYJYIZIAWUD +# BAIBBQCgggFKMBoGCSqGSIb3DQEJAzENBgsqhkiG9w0BCRABBDAvBgkqhkiG9w0B +# CQQxIgQgbjk/IiL8KyUtICVXFblxmt8j6F3g0s6KsH+WJzhAIqAwgfoGCyqGSIb3 +# DQEJEAIvMYHqMIHnMIHkMIG9BCApVb08M25w+tYGWsmlGtp1gy1nPcqWfqgMF3nl +# WYVzBTCBmDCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9u +# MRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRp +# b24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAAB +# uh8/GffBdb18AAEAAAG6MCIEIJ9hCOdmkSHZdWHnjcQBaILiGo+/uNr71agjiWaN +# bF2dMA0GCSqGSIb3DQEBCwUABIICACgD9Dbo/LkUWEGprq7D+RTXofFwwH6qSKeh +# N1y8UNvmYAtF83AuC2amIWELSmnnblZEv1sMvjteyyLsLRuid8la04mjjLUBduUN +# yGhij+4aarTuuVuwf/Ap273AGk1mv3slKF3R7lQnObcO4SEXYYoDeBDY/HI8Pa3g +# 6FkNw18RsDp3Atj0Eun/UZaL+XCNHPJCsLoEK69bz9cxhiEwQfcEhc9kDzKTqjZV +# Yla/8Qh+WoC/0uQz1lEpQvP4vrSVOXw89ZGUicwjRHZ3Oys2IgPu5vrG3BeFZNCO +# q3ieylUYWrOBvIxZQWcHR5tqmwdQDnUHRR6vZNVxqErZ0dLdd824gFoKGUbup0MG +# SdD/k2nffp38SFvsfiDiO6DRwt49LX5ClzxeXt4LFv9GTNq4/9vlInIQoi9BujGg +# 3vJIDEVxEDZzq//guGDkz1ybPLz3/hrSzySBD5YWaVtcqapTPGMxqSOcwjFD9AbY +# 5BYD0o6/0lXAIBQVLCI4elTZToeECLJkkerZA79OU9UJFL6cdrr5s6KENdLQkXIO +# o3M2KywJgUYUVK4v2mSeUzyahW3XW0+i5K03EPAlDi4ONFZZSE5l73er2SziU0go +# a8R5O6oYM6AAPmSBTX/6EpF1vb5fkPfOSI3nBe1TBlovGg3WvWQGn9Ft5B/kSq6F +# MXMUpngZ +# SIG # End signature block diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/FuzzySharp.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/FuzzySharp.dll new file mode 100644 index 000000000000..d25fb236c3e9 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/FuzzySharp.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Hyak.Common.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Hyak.Common.dll new file mode 100644 index 000000000000..18a53248894f Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Hyak.Common.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.ApplicationInsights.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.ApplicationInsights.dll new file mode 100644 index 000000000000..8ef5eef2989d Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.ApplicationInsights.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.Common.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.Common.dll new file mode 100644 index 000000000000..1c9d8e2a0ef5 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.Common.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AssemblyLoading.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AssemblyLoading.dll new file mode 100644 index 000000000000..38f5f8542077 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AssemblyLoading.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll new file mode 100644 index 000000000000..77cc1c46f5a7 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll new file mode 100644 index 000000000000..d8429b2b6881 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.dll new file mode 100644 index 000000000000..1503a5b6d3ac Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll new file mode 100644 index 000000000000..acc0eb23524f Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authenticators.dll new file mode 100644 index 000000000000..1d35ab395d17 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Aks.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Aks.dll new file mode 100644 index 000000000000..3ab15df83c30 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Aks.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Authorization.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Authorization.dll new file mode 100644 index 000000000000..4b6131e2a0f6 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Authorization.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Compute.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Compute.dll new file mode 100644 index 000000000000..b5c2285f8237 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Compute.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll new file mode 100644 index 000000000000..afd56a7b9208 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.KeyVault.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.KeyVault.dll new file mode 100644 index 000000000000..b6838bea7093 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.KeyVault.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Monitor.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Monitor.dll new file mode 100644 index 000000000000..d28204acd31a Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Monitor.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Network.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Network.dll new file mode 100644 index 000000000000..b35c96f4c5cb Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Network.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll new file mode 100644 index 000000000000..3a37aeb3a3d5 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll new file mode 100644 index 000000000000..6b3270044fbc Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll new file mode 100644 index 000000000000..eaa53e5a4ac9 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Websites.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Websites.dll new file mode 100644 index 000000000000..947ac62a5ac0 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Websites.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll new file mode 100644 index 000000000000..f2f380543ee1 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml new file mode 100644 index 000000000000..07d9948aca17 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml @@ -0,0 +1,13631 @@ + + + + + Add-AzEnvironment + Add + AzEnvironment + + Adds endpoints and metadata for an instance of Azure Resource Manager. + + + + The Add-AzEnvironment cmdlet adds endpoints and metadata to enable Azure Resource Manager cmdlets to connect with a new instance of Azure Resource Manager. The built-in environments AzureCloud and AzureChinaCloud target existing public instances of Azure Resource Manager. + + + + Add-AzEnvironment + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + + System.Management.Automation.SwitchParameter + + + False + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. The parameter is to set the value to `GalleryUrl` of `PSAzureEnvironment`. As `GalleryUrl` is removed from ArmMetadata, Azure PowerShell will no longer provide for the value and so it is not recommended to set `GalleryEndpoint` anymore. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Add-AzEnvironment + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Add-AzEnvironment + + AutoDiscover + + Discovers environments via default or configured endpoint. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Uri + + Specifies URI of the internet resource to fetch environments. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint + + System.String + + System.String + + + None + + + AutoDiscover + + Discovers environments via default or configured endpoint. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. The parameter is to set the value to `GalleryUrl` of `PSAzureEnvironment`. As `GalleryUrl` is removed from ArmMetadata, Azure PowerShell will no longer provide for the value and so it is not recommended to set `GalleryEndpoint` anymore. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + Uri + + Specifies URI of the internet resource to fetch environments. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and modifying a new environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Set-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint NewTestADEndpoint ` + -GraphEndpoint NewTestGraphEndpoint | Format-List + +Name : TestEnvironment +EnableAdfsAuthentication : False +OnPremise : False +ActiveDirectoryServiceEndpointResourceId : TestADApplicationId +AdTenant : +GalleryUrl : TestGalleryEndpoint +ManagementPortalUrl : +ServiceManagementUrl : +PublishSettingsFileUrl : +ResourceManagerUrl : TestRMEndpoint +SqlDatabaseDnsSuffix : +StorageEndpointSuffix : +ActiveDirectoryAuthority : NewTestADEndpoint +GraphUrl : NewTestGraphEndpoint +GraphEndpointResourceId : +TrafficManagerDnsSuffix : +AzureKeyVaultDnsSuffix : +DataLakeEndpointResourceId : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : +AzureOperationalInsightsEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureAnalysisServicesEndpointSuffix : +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : +AzureSynapseAnalyticsEndpointResourceId : +VersionProfiles : {} +ExtendedProperties : {} +BatchEndpointResourceId : + + In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. + + + + + + ------- Example 2: Discovering a new environment via Uri ------- + <# +Uri https://configuredmetadata.net returns an array of environment metadata. The following example contains a payload for the AzureCloud default environment. + +[ + { + "portal": "https://portal.azure.com", + "authentication": { + "loginEndpoint": "https://login.microsoftonline.com/", + "audiences": [ + "https://management.core.windows.net/" + ], + "tenant": "common", + "identityProvider": "AAD" + }, + "media": "https://rest.media.azure.net", + "graphAudience": "https://graph.windows.net/", + "graph": "https://graph.windows.net/", + "name": "AzureCloud", + "suffixes": { + "azureDataLakeStoreFileSystem": "azuredatalakestore.net", + "acrLoginServer": "azurecr.io", + "sqlServerHostname": ".database.windows.net", + "azureDataLakeAnalyticsCatalogAndJob": "azuredatalakeanalytics.net", + "keyVaultDns": "vault.azure.net", + "storage": "core.windows.net", + "azureFrontDoorEndpointSuffix": "azurefd.net" + }, + "batch": "https://batch.core.windows.net/", + "resourceManager": "https://management.azure.com/", + "vmImageAliasDoc": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json", + "activeDirectoryDataLake": "https://datalake.azure.net/", + "sqlManagement": "https://management.core.windows.net:8443/", + "gallery": "https://gallery.azure.com/" + }, +…… +] +#> + +Add-AzEnvironment -AutoDiscover -Uri https://configuredmetadata.net + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + + In this example, we are discovering a new Azure environment from the `https://configuredmetadata.net` Uri. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/add-azenvironment + + + Get-AzEnvironment + + + + Remove-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Clear-AzConfig + Clear + AzConfig + + Clears the values of configs that are set by the user. + + + + Clears the values of configs that are set by the user. By default all the configs will be cleared. You can also specify keys of configs to clear. + + + + Clear-AzConfig + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + + System.Management.Automation.SwitchParameter + + + False + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + + System.Management.Automation.SwitchParameter + + + False + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + + System.Management.Automation.SwitchParameter + + + False + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Returns true if cmdlet executes correctly. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + + CurrentUser + Process + Default + Environment + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Clear-AzConfig + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Do not ask for confirmation when clearing all configs. + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Returns true if cmdlet executes correctly. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + + CurrentUser + Process + Default + Environment + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Force + + Do not ask for confirmation when clearing all configs. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Returns true if cmdlet executes correctly. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Clear-AzConfig -Force + + Clear all the configs. `-Force` suppresses the prompt for confirmation. + + + + + + -------------------------- Example 2 -------------------------- + Clear-AzConfig -EnableDataCollection + + Clear the "EnableDataCollection" config. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/clear-azconfig + + + + + + Clear-AzContext + Clear + AzContext + + Remove all Azure credentials, account, and subscription information. + + + + Remove all Azure Credentials, account, and subscription information. + + + + Clear-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Delete all users and groups from the global scope without prompting + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return a value indicating success or failure + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Clear the context only for the current PowerShell session, or for all sessions. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Delete all users and groups from the global scope without prompting + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return a value indicating success or failure + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Clear the context only for the current PowerShell session, or for all sessions. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + --------------- Example 1: Clear global context --------------- + Clear-AzContext -Scope CurrentUser + + Remove all account, subscription, and credential information for any powershell session. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/clear-azcontext + + + + + + Clear-AzDefault + Clear + AzDefault + + Clears the defaults set by the user in the current context. + + + + The Clear-AzDefault cmdlet removes the defaults set by the user depending on the switch parameters specified by the user. + + + + Clear-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove all defaults if no default is specified + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroup + + Clear Default Resource Group + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove all defaults if no default is specified + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroup + + Clear Default Resource Group + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Clear-AzDefault + + This command removes all the defaults set by the user in the current context. + + + + + + -------------------------- Example 2 -------------------------- + Clear-AzDefault -ResourceGroup + + This command removes the default resource group set by the user in the current context. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/clear-azdefault + + + + + + Connect-AzAccount + Connect + AzAccount + + Connect to Azure with an authenticated account for use with cmdlets from the Az PowerShell modules. + + + + The `Connect-AzAccount` cmdlet connects to Azure with an authenticated account for use with cmdlets from the Az PowerShell modules. You can use this authenticated account only with Azure Resource Manager requests. To add an authenticated account for use with Service Management, use the `Add-AzureAccount` cmdlet from the Azure PowerShell module. If no context is found for the current user, the user's context list is populated with a context for each of their first 25 subscriptions. The list of contexts created for the user can be found by running `Get-AzContext -ListAvailable`. To skip this context population, specify the SkipContextPopulation switch parameter. After executing this cmdlet, you can disconnect from an Azure account using `Disconnect-AzAccount`. + + + + Connect-AzAccount + + AccessToken + + Specifies an access token. + > [!CAUTION] > Access tokens are a type of credential. You should take the appropriate security precautions to > keep them confidential. Access tokens also timeout and may prevent long running tasks from > completing. + + System.String + + System.String + + + None + + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + GraphAccessToken + + AccessToken for Graph Service. + + System.String + + System.String + + + None + + + KeyVaultAccessToken + + AccessToken for KeyVault Service. + + System.String + + System.String + + + None + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + MicrosoftGraphAccessToken + + Access token to Microsoft Graph + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipValidation + + Skip validation for access token. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + UseDeviceAuthentication + + Use device code authentication instead of a browser control. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + Identity + + Login using a Managed Service Identity. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + CertificateThumbprint + + Certificate Hash or Thumbprint. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + FederatedToken + + Specifies a token provided by another identity provider. The issuer and subject in this token must be first configured to be trusted by the ApplicationId. + > [!CAUTION] > Federated tokens are a type of credential. You should take the appropriate security precautions to keep them confidential. Federated tokens also timeout and may prevent long running tasks from completing. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + CertificatePassword + + The password required to access the pkcs#12 certificate file. + + System.Security.SecureString + + System.Security.SecureString + + + None + + + CertificatePath + + The path of certficate file in pkcs#12 format. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AccessToken + + Specifies an access token. + > [!CAUTION] > Access tokens are a type of credential. You should take the appropriate security precautions to > keep them confidential. Access tokens also timeout and may prevent long running tasks from > completing. + + System.String + + System.String + + + None + + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + CertificatePassword + + The password required to access the pkcs#12 certificate file. + + System.Security.SecureString + + System.Security.SecureString + + + None + + + CertificatePath + + The path of certficate file in pkcs#12 format. + + System.String + + System.String + + + None + + + CertificateThumbprint + + Certificate Hash or Thumbprint. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + FederatedToken + + Specifies a token provided by another identity provider. The issuer and subject in this token must be first configured to be trusted by the ApplicationId. + > [!CAUTION] > Federated tokens are a type of credential. You should take the appropriate security precautions to keep them confidential. Federated tokens also timeout and may prevent long running tasks from completing. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GraphAccessToken + + AccessToken for Graph Service. + + System.String + + System.String + + + None + + + Identity + + Login using a Managed Service Identity. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + KeyVaultAccessToken + + AccessToken for KeyVault Service. + + System.String + + System.String + + + None + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + MicrosoftGraphAccessToken + + Access token to Microsoft Graph + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + SkipValidation + + Skip validation for access token. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + UseDeviceAuthentication + + Use device code authentication instead of a browser control. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ------------ Example 1: Connect to an Azure account ------------ + Connect-AzAccount + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 2: Connect to Azure using organizational ID credentials + $Credential = Get-Credential +Connect-AzAccount -Credential $Credential + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 3: Connect to Azure using a service principal account + $SecurePassword = ConvertTo-SecureString -String "Password123!" -AsPlainText -Force +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz' +$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $ApplicationId, $SecurePassword +Connect-AzAccount -ServicePrincipal -TenantId $TenantId -Credential $Credential + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxx-xxxx-xxxx-xxxx Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 4: Use an interactive login to connect to a specific tenant and subscription + Connect-AzAccount -Tenant 'xxxx-xxxx-xxxx-xxxx' -SubscriptionId 'yyyy-yyyy-yyyy-yyyy' + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ----- Example 5: Connect using a Managed Service Identity ----- + Connect-AzAccount -Identity +Set-AzContext -Subscription Subscription1 + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +MSI@50342 Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 6: Connect using Managed Service Identity login and ClientId + $identity = Get-AzUserAssignedIdentity -ResourceGroupName 'myResourceGroup' -Name 'myUserAssignedIdentity' +Get-AzVM -ResourceGroupName contoso -Name testvm | Update-AzVM -IdentityType UserAssigned -IdentityId $identity.Id +Connect-AzAccount -Identity -AccountId $identity.ClientId # Run on the virtual machine + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +yyyy-yyyy-yyyy-yyyy Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ------------ Example 7: Connect using certificates ------------ + $Thumbprint = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = '00000000-0000-0000-0000-00000000' +Connect-AzAccount -CertificateThumbprint $Thumbprint -ApplicationId $ApplicationId -Tenant $TenantId -ServicePrincipal + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + +Account : xxxxxxxx-xxxx-xxxx-xxxxxxxx +SubscriptionName : MyTestSubscription +SubscriptionId : zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz +TenantId : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy +Environment : AzureCloud + + + + + + + + -------------- Example 8: Connect with AuthScope -------------- + Connect-AzAccount -AuthScope Storage + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +yyyy-yyyy-yyyy-yyyy Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ---------- Example 9: Connect using certificate file ---------- + $SecurePassword = ConvertTo-SecureString -String "Password123!" -AsPlainText -Force +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz' +Connect-AzAccount -ServicePrincipal -ApplicationId $ApplicationId -TenantId $TenantId -CertificatePath './certificatefortest.pfx' -CertificatePassword $securePassword + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + + + + + + + + --------- Example 10: Connect interactively using WAM --------- + Update-AzConfig -EnableLoginByWam $true +Connect-AzAccount + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/connect-azaccount + + + + + + Disable-AzContextAutosave + Disable + AzContextAutosave + + Turn off autosaving Azure credentials. Your login information will be forgotten the next time you open a PowerShell window + + + + Turn off autosaving Azure credentials. Your login information will be forgotten the next time you open a PowerShell window + + + + Disable-AzContextAutosave + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + ---------- Example 1: Disable autosaving the context ---------- + Disable-AzContextAutosave + + Disable autosave for the current user. + + + + + + -------------------------- Example 2 -------------------------- + Disable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/disable-azcontextautosave + + + + + + Disable-AzDataCollection + Disable + AzDataCollection + + Opts out of collecting data to improve the Azure PowerShell cmdlets. Data is collected by default unless you explicitly opt out. + + + + The `Disable-AzDataCollection` cmdlet is used to opt out of data collection. Azure PowerShell automatically collects telemetry data by default. To disable data collection, you must explicitly opt-out. Microsoft aggregates collected data to identify patterns of usage, to identify common issues, and to improve the experience of Azure PowerShell. Microsoft Azure PowerShell doesn't collect any private or personal data. If you've previously opted out, run the `Enable-AzDataCollection` cmdlet to re-enable data collection for the current user on the current machine. + + + + Disable-AzDataCollection + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + -- Example 1: Disabling data collection for the current user -- + Disable-AzDataCollection + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/disable-azdatacollection + + + Enable-AzDataCollection + + + + + + + Disable-AzureRmAlias + Disable + AzureRmAlias + + Disables AzureRm prefix aliases for Az modules. + + + + Disables AzureRm prefix aliases for Az modules. If -Module is specified, only modules listed will have aliases disabled. Otherwise all AzureRm aliases are disabled. + + + + Disable-AzureRmAlias + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to disable aliases for. If none are specified, default is all enabled modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all disabled aliases + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be disabled for. Default is 'Process' + + + Process + CurrentUser + LocalMachine + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to disable aliases for. If none are specified, default is all enabled modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all disabled aliases + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be disabled for. Default is 'Process' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Disable-AzureRmAlias + + Disables all AzureRm prefixes for the current PowerShell session. + + + + + + -------------------------- Example 2 -------------------------- + Disable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser + + Disables AzureRm aliases for the Az.Accounts module for both the current process and for the current user. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/disable-azurermalias + + + + + + Disconnect-AzAccount + Disconnect + AzAccount + + Disconnects a connected Azure account and removes all credentials and contexts associated with that account. + + + + The Disconnect-AzAccount cmdlet disconnects a connected Azure account and removes all credentials and contexts (subscription and tenant information) associated with that account. After executing this cmdlet, you will need to login again using Connect-AzAccount. + + + + Disconnect-AzAccount + + ApplicationId + + ServicePrincipal id (globally unique id) + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + TenantId + + Tenant id (globally unique id) + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + AzureContext + + Context + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + ContextName + + Name of the context to log out of + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + InputObject + + The account object to remove + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + Username + + User name of the form 'user@contoso.org' + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ApplicationId + + ServicePrincipal id (globally unique id) + + System.String + + System.String + + + None + + + AzureContext + + Context + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + ContextName + + Name of the context to log out of + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + The account object to remove + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + TenantId + + Tenant id (globally unique id) + + System.String + + System.String + + + None + + + Username + + User name of the form 'user@contoso.org' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + + + + + + + + ----------- Example 1: Logout of the current account ----------- + Disconnect-AzAccount + + Logs out of the Azure account associated with the current context. + + + + + + Example 2: Logout of the account associated with a particular context + Get-AzContext "Work" | Disconnect-AzAccount -Scope CurrentUser + + Logs out the account associated with the given context (named 'Work'). Because this uses the 'CurrentUser' scope, all credentials and contexts will be permanently deleted. + + + + + + ------------- Example 3: Log out a particular user ------------- + Disconnect-AzAccount -Username 'user1@contoso.org' + + Logs out the 'user1@contoso.org' user - all credentials and all contexts associated with this user will be removed. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/disconnect-azaccount + + + + + + Enable-AzContextAutosave + Enable + AzContextAutosave + + Azure contexts are PowerShell objects representing your active subscription to run commands against, and the authentication information needed to connect to an Azure cloud. With Azure contexts, Azure PowerShell doesn't need to reauthenticate your account each time you switch subscriptions. For more information, see Azure PowerShell context objects (https://learn.microsoft.com/powershell/azure/context-persistence). + This cmdlet allows the Azure context information to be saved and automatically loaded when you start a PowerShell process. For example, when opening a new window. + + + + Allows the Azure context information to be saved and automatically loaded when a PowerShell process starts. The context is saved at the end of the execution of any cmdlet that affects the context. For example, any profile cmdlet. If you're using user authentication, then tokens can be updated during the course of running any cmdlet. + + + + Enable-AzContextAutosave + + DefaultProfile + + The credentials, tenant, and subscription used for communication with Azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes. For example, whether changes apply only to the current process, or to all sessions started by this user. Changes made with the scope `CurrentUser` will affect all PowerShell sessions started by the user. If a particular session needs to have different settings, use the scope `Process`. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + CurrentUser + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet isn't run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with Azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes. For example, whether changes apply only to the current process, or to all sessions started by this user. Changes made with the scope `CurrentUser` will affect all PowerShell sessions started by the user. If a particular session needs to have different settings, use the scope `Process`. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + CurrentUser + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet isn't run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + Example 1: Enable autosaving credentials for the current user + Enable-AzContextAutosave + + + + + + + + -------------------------- Example 2 -------------------------- + Enable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/enable-azcontextautosave + + + + + + Enable-AzDataCollection + Enable + AzDataCollection + + Enables Azure PowerShell to collect data to improve the user experience with the Azure PowerShell cmdlets. Executing this cmdlet opts in to data collection for the current user on the current machine. Data is collected by default unless you explicitly opt out. + + + + The `Enable-AzDataCollection` cmdlet is used to opt in to data collection. Azure PowerShell automatically collects telemetry data by default. Microsoft aggregates collected data to identify patterns of usage, to identify common issues, and to improve the experience of Azure PowerShell. Microsoft Azure PowerShell doesn't collect any private or personal data. To disable data collection, you must explicitly opt out by executing `Disable-AzDataCollection`. + + + + Enable-AzDataCollection + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + --- Example 1: Enabling data collection for the current user --- + Enable-AzDataCollection + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/enable-azdatacollection + + + Disable-AzDataCollection + + + + + + + Enable-AzureRmAlias + Enable + AzureRmAlias + + Enables AzureRm prefix aliases for Az modules. + + + + Enables AzureRm prefix aliases for Az modules. If -Module is specified, only modules listed will have aliases enabled. Otherwise all AzureRm aliases are enabled. + + + + Enable-AzureRmAlias + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to enable aliases for. If none are specified, default is all modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all aliases enabled + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be enabled for. Default is 'Local' + + + Local + Process + CurrentUser + LocalMachine + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to enable aliases for. If none are specified, default is all modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all aliases enabled + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be enabled for. Default is 'Local' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Enable-AzureRmAlias + + Enables all AzureRm prefixes for the current PowerShell session. + + + + + + -------------------------- Example 2 -------------------------- + Enable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser + + Enables AzureRm aliases for the Az.Accounts module for both the current process and for the current user. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/enable-azurermalias + + + + + + Export-AzConfig + Export + AzConfig + + Exports all the configs into a file so that it can be imported on another machine. + + + + The `Export-AzConfig` cmdlet exports all the configs that are set at the "CurrentUser" scope into a file at given path in JSON format. The file can then be imported by `Import-AzConfig` for example on another machine. + + + + Export-AzConfig + + Path + + Specifies the path of the file to which to save the configs. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrites the given file if it exists. + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Returns a boolean value indicating success or failure. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrites the given file if it exists. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Returns a boolean value indicating success or failure. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Path + + Specifies the path of the file to which to save the configs. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Export-AzConfig -Path ./config.json + + This example exports the configs to `./config.json` file which can later be imported via `Import-AzConfig`. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/export-azconfig + + + Import-AzConfig + + + + + + + Get-AzAccessToken + Get + AzAccessToken + + Get raw access token. When using -ResourceUrl, please make sure the value does match current Azure environment. You may refer to the value of `(Get-AzContext).Environment`. + + + + Get access token + + + + Get-AzAccessToken + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + IAzureContextContainer + + IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, AppConfiguration, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + String + + String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + String + + String + + + None + + + + Get-AzAccessToken + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + IAzureContextContainer + + IAzureContextContainer + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + String + + String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + String + + String + + + None + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + IAzureContextContainer + + IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, AppConfiguration, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + String + + String + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + String + + String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + String + + String + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + + + + + + + + + + + + + ------- Example 1 Get the access token for ARM endpoint ------- + Get-AzAccessToken + + Get access token of current account for ResourceManager endpoint + + + + + + - Example 2 Get the access token for Microsoft Graph endpoint - + Get-AzAccessToken -ResourceTypeName MSGraph + + Get access token of Microsoft Graph endpoint for current account + + + + + + - Example 3 Get the access token for Microsoft Graph endpoint - + Get-AzAccessToken -ResourceUrl "https://graph.microsoft.com/" + + Get access token of Microsoft Graph endpoint for current account + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-azaccesstoken + + + + + + Get-AzConfig + Get + AzConfig + + Gets the configs of Azure PowerShell. + + + + Gets the configs of Azure PowerShell. By default it lists all the configs. You can filter the result using various parameters. + > [!NOTE] > Configs have priorities. Generally speaking, Process scope has higher priority than CurrentUser scope; a config that applies to a certain cmdlet has higher priority than that applies to a module, again higher than Az. > To reduce confusion, the result of `Get-AzConfig` shows those configs that are taking effect. It is a combination of all the configs, but not literally all the configs. However, you could always view them by applying different filter parameters, such as `-Scope`. + + + + Get-AzConfig + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + + System.Management.Automation.SwitchParameter + + + False + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + + System.Management.Automation.SwitchParameter + + + False + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + + System.Management.Automation.SwitchParameter + + + False + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + + CurrentUser + Process + Default + Environment + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + + + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSConfig + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Get-AzConfig + +Key Value Applies To Scope Help Message +--- ----- ---------- ----- ------------ +EnableDataCollection False Az CurrentUser When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the custom… +DefaultSubscriptionForLogin Az Default Subscription name or GUID. Sets the default context for Azure PowerShell when logging in with… +DisplayBreakingChangeWarning True Az Default Controls if warning messages for breaking changes are displayed or suppressed. When enabled, … + + Gets all the configs. + + + + + + -------------------------- Example 2 -------------------------- + Get-AzConfig -EnableDataCollection + +Key Value Applies To Scope Help Message +--- ----- ---------- ----- ------------ +EnableDataCollection False Az CurrentUser When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the custom… + + Gets the "EnableDataCollection" config. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-azconfig + + + + + + Get-AzContext + Get + AzContext + + Gets the metadata used to authenticate Azure Resource Manager requests. + + + + The Get-AzContext cmdlet gets the current metadata used to authenticate Azure Resource Manager requests. This cmdlet gets the Active Directory account, Active Directory tenant, Azure subscription, and the targeted Azure environment. Azure Resource Manager cmdlets use these settings by default when making Azure Resource Manager requests. When the available amount of subscription exceeds the default limit of 25, some subscriptions may not show up in the results of `Get-AzContext -ListAvailable`. Please run `Connect-AzAccount -MaxContextPopulation <int>` to get more contexts. + + + + Get-AzContext + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ListAvailable + + List all available contexts in the current session. + + + System.Management.Automation.SwitchParameter + + + False + + + RefreshContextFromTokenCache + + Refresh contexts from token cache + + + System.Management.Automation.SwitchParameter + + + False + + + + Get-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ListAvailable + + List all available contexts in the current session. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + The name of the context + + System.String + + System.String + + + None + + + RefreshContextFromTokenCache + + Refresh contexts from token cache + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ------------ Example 1: Getting the current context ------------ + Connect-AzAccount +Get-AzContext + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + In this example we are logging into our account with an Azure subscription using Connect-AzAccount, and then we are getting the context of the current session by calling Get-AzContext. + + + + + + ---------- Example 2: Listing all available contexts ---------- + Get-AzContext -ListAvailable + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... +Subscription2 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription2 AzureCloud xxxxxxxx-x... +Subscription3 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription3 AzureCloud xxxxxxxx-x... + + In this example, all currently available contexts are displayed. The user may select one of these contexts using Select-AzContext. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-azcontext + + + Set-AzContext + + + + Connect-AzAccount + + + + + + + Get-AzContextAutosaveSetting + Get + AzContextAutosaveSetting + + Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found. + + + + Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found. + + + + Get-AzContextAutosaveSetting + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + ------ Get context save metadata for the current session ------ + Get-AzContextAutosaveSetting + +Mode : Process +ContextDirectory : None +ContextFile : None +CacheDirectory : None +CacheFile : None +Settings : {} + + Get details about whether and where the context is saved. In the above example, the autosave feature has been disabled. + + + + + + -------- Get context save metadata for the current user -------- + Get-AzContextAutosaveSetting -Scope CurrentUser + +Mode : CurrentUser +ContextDirectory : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell +ContextFile : AzureRmContext.json +CacheDirectory : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell +CacheFile : TokenCache.dat +Settings : {} + + Get details about whether and where the context is saved by default for the current user. Note that this may be different than the settings that are active in the current session. In the above example, the autosave feature has been enabled, and data is saved to the default location. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-azcontextautosavesetting + + + + + + Get-AzDefault + Get + AzDefault + + Get the defaults set by the user in the current context. + + + + The Get-AzDefault cmdlet gets the Resource Group that the user has set as default in the current context. + + + + Get-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceGroup + + Display Default Resource Group + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceGroup + + Display Default Resource Group + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSResourceGroup + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Get-AzDefault + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command returns the current defaults if there are defaults set, or returns nothing if no default is set. + + + + + + -------------------------- Example 2 -------------------------- + Get-AzDefault -ResourceGroup + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command returns the current default Resource Group if there is a default set, or returns nothing if no default is set. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-azdefault + + + + + + Get-AzEnvironment + Get + AzEnvironment + + Get endpoints and metadata for an instance of Azure services. `GalleryUrl` will be removed from ArmMetadata and so Azure PowerShell will no longer provide for its value in `PSAzureEnvironment`. Currently `GalleryUrl` is not used in Azure PowerShell products. Please do not reply on `GalleryUrl` anymore. + + + + The Get-AzEnvironment cmdlet gets endpoints and metadata for an instance of Azure services. + + + + Get-AzEnvironment + + Name + + Specifies the name of the Azure instance to get. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Name + + Specifies the name of the Azure instance to get. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ---------- Example 1: Getting all Azure environments ---------- + Get-AzEnvironment + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureUSGovernment https://management.usgovcloudapi.net/ https://login.microsoftonline.us/ Built-in +AzureCloud https://management.azure.com/ https://login.microsoftonline.com/ Built-in +AzureChinaCloud https://management.chinacloudapi.cn/ https://login.chinacloudapi.cn/ Built-in + + This example shows how to get the endpoints and metadata for the AzureCloud (default) environment. + + + + + + -------- Example 2: Getting the AzureCloud environment -------- + Get-AzEnvironment -Name AzureCloud + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureCloud https://management.azure.com/ https://login.microsoftonline.com/ Built-in + + This example shows how to get the endpoints and metadata for the AzureCloud (default) environment. + + + + + + ------ Example 3: Getting the AzureChinaCloud environment ------ + Get-AzEnvironment -Name AzureChinaCloud | Format-List + +Name : AzureChinaCloud +Type : Built-in +EnableAdfsAuthentication : False +OnPremise : False +ActiveDirectoryServiceEndpointResourceId : https://management.core.chinacloudapi.cn/ +AdTenant : Common +GalleryUrl : https://gallery.azure.com/ +ManagementPortalUrl : https://go.microsoft.com/fwlink/?LinkId=301902 +ServiceManagementUrl : https://management.core.chinacloudapi.cn/ +PublishSettingsFileUrl : https://go.microsoft.com/fwlink/?LinkID=301776 +ResourceManagerUrl : https://management.chinacloudapi.cn/ +SqlDatabaseDnsSuffix : .database.chinacloudapi.cn +StorageEndpointSuffix : core.chinacloudapi.cn +ActiveDirectoryAuthority : https://login.chinacloudapi.cn/ +GraphUrl : https://graph.chinacloudapi.cn/ +GraphEndpointResourceId : https://graph.chinacloudapi.cn/ +TrafficManagerDnsSuffix : trafficmanager.cn +AzureKeyVaultDnsSuffix : vault.azure.cn +DataLakeEndpointResourceId : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : https://vault.azure.cn +ContainerRegistryEndpointSuffix : azurecr.cn +AzureOperationalInsightsEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureAnalysisServicesEndpointSuffix : asazure.chinacloudapi.cn +AnalysisServicesEndpointResourceId : https://region.asazure.chinacloudapi.cn +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : dev.azuresynapse.azure.cn +AzureSynapseAnalyticsEndpointResourceId : https://dev.azuresynapse.azure.cn + + This example shows how to get the endpoints and metadata for the AzureChinaCloud environment. + + + + + + ----- Example 4: Getting the AzureUSGovernment environment ----- + Get-AzEnvironment -Name AzureUSGovernment + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureUSGovernment https://management.usgovcloudapi.net/ https://login.microsoftonline.us/ Built-in + + This example shows how to get the endpoints and metadata for the AzureUSGovernment environment. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-azenvironment + + + Add-AzEnvironment + + + + Remove-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Get-AzSubscription + Get + AzSubscription + + Get subscriptions that the current account can access. + + + + The Get-AzSubscription cmdlet gets the subscription ID, subscription name, and home tenant for subscriptions that the current account can access. + + + + Get-AzSubscription + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionId + + Specifies the ID of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + Get-AzSubscription + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionName + + Specifies the name of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionId + + Specifies the ID of the subscription to get. + + System.String + + System.String + + + None + + + SubscriptionName + + Specifies the name of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + + + + + + + + + + ------- Example 1: Get all subscriptions in all tenants ------- + Get-AzSubscription + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled +Subscription3 zzzz-zzzz-zzzz-zzzz bbbb-bbbb-bbbb-bbbb Enabled + + This command gets all subscriptions in all tenants that are authorized for the current account. + + + + + + ---- Example 2: Get all subscriptions for a specific tenant ---- + Get-AzSubscription -TenantId "aaaa-aaaa-aaaa-aaaa" + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled + + List all subscriptions in the given tenant that are authorized for the current account. + + + + + + ---- Example 3: Get all subscriptions in the current tenant ---- + Get-AzSubscription -TenantId (Get-AzContext).Tenant + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled + + This command gets all subscriptions in the current tenant that are authorized for the current user. + + + + + + Example 4: Change the current context to use a specific subscription + Get-AzSubscription -SubscriptionId "xxxx-xxxx-xxxx-xxxx" -TenantId "yyyy-yyyy-yyyy-yyyy" | Set-AzContext + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxx-xxxx-xxxx-xxxx) azureuser@micros... Subscription1 AzureCloud yyyy-yyyy-yyyy-yyyy + + This command gets the specified subscription, and then sets the current context to use it. All subsequent cmdlets in this session use the new subscription (Contoso Subscription 1) by default. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-azsubscription + + + + + + Get-AzTenant + Get + AzTenant + + Gets tenants that are authorized for the current user. + + + + The Get-AzTenant cmdlet gets tenants authorized for the current user. + + + + Get-AzTenant + + TenantId + + Specifies the ID of the tenant that this cmdlet gets. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + TenantId + + Specifies the ID of the tenant that this cmdlet gets. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + + + + + + + + + + ---------------- Example 1: Getting all tenants ---------------- + Connect-AzAccount +Get-AzTenant + +Id Name Category Domains +-- ----------- -------- ------- +xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...} +yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy Testhost Home testhost.onmicrosoft.com + + This example shows how to get all of the authorized tenants of an Azure account. + + + + + + ------------- Example 2: Getting a specific tenant ------------- + Connect-AzAccount +Get-AzTenant -TenantId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +Id Name Category Domains +-- ----------- -------- ------- +xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...} + + This example shows how to get a specific authorized tenant of an Azure account. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-aztenant + + + + + + Import-AzConfig + Import + AzConfig + + Imports configs from a file that was previously exported by `Export-AzConfig`. + + + + The `Import-AzConfig` cmdlet imports all the configs from a file that was previously exported by `Export-AzConfig`. The imported configs will be set at the "CurrentUser" scope, so they are consistent across PowerShell sessions. + During importing, if a config that is to be imported has already been set, its value will be overwritten. + + + + Import-AzConfig + + Path + + Specifies the path to configuration saved by using Export-AzConfig. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Returns a boolean value indicating success or failure. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Returns a boolean value indicating success or failure. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Path + + Specifies the path to configuration saved by using Export-AzConfig. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Import-AzConfig -Path ./config.json + + This example imports configs from file `./config.json`. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/import-azconfig + + + Export-AzConfig + + + + + + + Import-AzContext + Import + AzContext + + Loads Azure authentication information from a file. + + + + The Import-AzContext cmdlet loads authentication information from a file to set the Azure environment and context. Cmdlets that you run in the current session use this information to authenticate requests to Azure Resource Manager. + + + + Import-AzContext + + AzureContext + + {{Fill AzureContext Description}} + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Import-AzContext + + Path + + Specifies the path to context information saved by using Save-AzContext. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AzureContext + + {{Fill AzureContext Description}} + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Path + + Specifies the path to context information saved by using Save-AzContext. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ----- Example 1: Importing a context from a AzureRmProfile ----- + Import-AzContext -AzContext (Connect-AzAccount) + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + This example imports a context from a PSAzureProfile that is passed through to the cmdlet. + + + + + + ------- Example 2: Importing a context from a JSON file ------- + Import-AzContext -Path C:\test.json + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + This example selects a context from a JSON file that is passed through to the cmdlet. This JSON file can be created from Save-AzContext. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/import-azcontext + + + + + + Invoke-AzRestMethod + Invoke + AzRestMethod + + Construct and perform HTTP request to Azure resource management endpoint only + + + + Construct and perform HTTP request to Azure resource management endpoint only + + + + Invoke-AzRestMethod + + ApiVersion + + Api Version + + System.String + + System.String + + + None + + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Name + + list of Target Resource Name + + System.String[] + + System.String[] + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceGroupName + + Target Resource Group Name + + System.String + + System.String + + + None + + + ResourceProviderName + + Target Resource Provider Name + + System.String + + System.String + + + None + + + ResourceType + + List of Target Resource Type + + System.String[] + + System.String[] + + + None + + + SubscriptionId + + Target Subscription Id + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Invoke-AzRestMethod + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Path + + Path of target resource URL. Hostname of Resource Manager should not be added. + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Invoke-AzRestMethod + + Uri + + Uniform Resource Identifier of the Azure resources. The target resource needs to support Azure AD authentication and the access token is derived according to resource id. If resource id is not set, its value is derived according to built-in service suffixes in current Azure Environment. + + System.Uri + + System.Uri + + + None + + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceId + + Identifier URI specified by the REST API you are calling. It shouldn't be the resource id of Azure Resource Manager. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ApiVersion + + Api Version + + System.String + + System.String + + + None + + + AsJob + + Run cmdlet in the background + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + System.String + + System.String + + + None + + + Name + + list of Target Resource Name + + System.String[] + + System.String[] + + + None + + + Path + + Path of target resource URL. Hostname of Resource Manager should not be added. + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceGroupName + + Target Resource Group Name + + System.String + + System.String + + + None + + + ResourceId + + Identifier URI specified by the REST API you are calling. It shouldn't be the resource id of Azure Resource Manager. + + System.Uri + + System.Uri + + + None + + + ResourceProviderName + + Target Resource Provider Name + + System.String + + System.String + + + None + + + ResourceType + + List of Target Resource Type + + System.String[] + + System.String[] + + + None + + + SubscriptionId + + Target Subscription Id + + System.String + + System.String + + + None + + + Uri + + Uniform Resource Identifier of the Azure resources. The target resource needs to support Azure AD authentication and the access token is derived according to resource id. If resource id is not set, its value is derived according to built-in service suffixes in current Azure Environment. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.string + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSHttpResponse + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Invoke-AzRestMethod -Path "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}?api-version={API}" -Method GET + +Headers : {[Cache-Control, System.String[]], [Pragma, System.String[]], [x-ms-request-id, System.String[]], [Strict-Transport-Security, System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : { + "properties": { + "source": "Azure", + "customerId": "{customerId}", + "provisioningState": "Succeeded", + "sku": { + "name": "pergb2018", + "maxCapacityReservationLevel": 3000, + "lastSkuUpdate": "Mon, 25 May 2020 11:10:01 GMT" + }, + "retentionInDays": 30, + "features": { + "legacy": 0, + "searchVersion": 1, + "enableLogAccessUsingOnlyResourcePermissions": true + }, + "workspaceCapping": { + "dailyQuotaGb": -1.0, + "quotaNextResetTime": "Thu, 18 Jun 2020 05:00:00 GMT", + "dataIngestionStatus": "RespectQuota" + }, + "enableFailover": false, + "publicNetworkAccessForIngestion": "Enabled", + "publicNetworkAccessForQuery": "Enabled", + "createdDate": "Mon, 25 May 2020 11:10:01 GMT", + "modifiedDate": "Mon, 25 May 2020 11:10:02 GMT" + }, + "id": "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}", + "name": "{workspace}", + "type": "Microsoft.OperationalInsights/workspaces", + "location": "eastasia", + "tags": {} + } + + Get log analytics workspace by path. It only supports management plane API and Hostname of Azure Resource Manager is added according to Azure environment setting. + + + + + + + -------------------------- Example 2 -------------------------- + Invoke-AzRestMethod https://graph.microsoft.com/v1.0/me + +Headers : {[Date, System.String[]], [Cache-Control, System.String[]], [Transfer-Encoding, System.String[]], [Strict-Transport-Security, System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : {"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users/$entity","businessPhones":["......} + + Get current signed in user via MicrosoftGraph API. This example is equivalent to `Get-AzADUser -SignedIn`. + + + + + + -------------------------- Example 3 -------------------------- + $subscriptionId = (Get-AzContext).Subscription.ID +Invoke-AzRestMethod -SubscriptionId $subscriptionId -ResourceGroupName "test-group" -ResourceProviderName Microsoft.AppPlatform -ResourceType Spring,apps -Name "test-spring-service" -ApiVersion 2020-07-01 -Method GET + +Headers : {[Cache-Control, System.String[]], [Pragma, System.String[]], [Vary, System.String[]], [x-ms-request-id, + System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : {"value":[{"properties":{"public":true,"url":"https://test-spring-service-demo.azuremicroservices.io","provisioni + ngState":"Succeeded","activeDeploymentName":"default","fqdn":"test-spring-service.azuremicroservices.io","httpsOn + ly":false,"createdTime":"2022-06-22T02:57:13.272Z","temporaryDisk":{"sizeInGB":5,"mountPath":"/tmp"},"pers + istentDisk":{"sizeInGB":0,"mountPath":"/persistent"}},"type":"Microsoft.AppPlatform/Spring/apps","identity + ":null,"location":"eastus","id":"/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.AppPlatform/Spring/test-spring-service/apps/demo","name":"demo"},{"properties":{"publ + ic":false,"provisioningState":"Succeeded","activeDeploymentName":"deploy01","fqdn":"test-spring-service.azuremicr + oservices.io","httpsOnly":false,"createdTime":"2022-06-22T07:46:54.9Z","temporaryDisk":{"sizeInGB":5,"moun + tPath":"/tmp"},"persistentDisk":{"sizeInGB":0,"mountPath":"/persistent"}},"type":"Microsoft.AppPlatform/Sp + ring/apps","identity":null,"location":"eastus","id":"/subscriptions/$subscriptionId/r + esourceGroups/test-group/providers/Microsoft.AppPlatform/Spring/test-spring-service/apps/pwsh01","name":"pwsh0 + 1"}]} + + List apps under spring service "test-spring-service" + + + + + + -------------------------- Example 4 -------------------------- + $subscriptionId = (Get-AzContext).Subscription.ID +Invoke-AzRestMethod -SubscriptionId $subscriptionId -ResourceGroupName "test-group" -ResourceProviderName Microsoft.AppPlatform -ResourceType Spring -Name "test-spring-service","demo" -ApiVersion 2020-07-01 -Method GET + +Headers : {[Cache-Control, System.String[]], [Pragma, System.String[]], [Vary, System.String[]], [x-ms-request-id, + System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : {"properties":{"public":true,"url":"https://test-spring-service-demo.azuremicroservices.io","provisioningState":" + Succeeded","activeDeploymentName":"default","fqdn":"test-spring-service.azuremicroservices.io","httpsOnly":false, + "createdTime":"2022-06-22T02:57:13.272Z","temporaryDisk":{"sizeInGB":5,"mountPath":"/tmp"},"persistentDisk + ":{"sizeInGB":0,"mountPath":"/persistent"}},"type":"Microsoft.AppPlatform/Spring/apps","identity":null,"lo + cation":"eastus","id":"/subscriptions/$subscriptionId/resourceGroups/test-group/pr + oviders/Microsoft.AppPlatform/Spring/test-spring-service/apps/demo","name":"demo"} + + Get app "demo" under Spring cloud service "test-spring-service" + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/invoke-azrestmethod + + + + + + Open-AzSurveyLink + Open + AzSurveyLink + + Open survey link in default browser. + + + + Open survey link in default browser. + + + + Open-AzSurveyLink + + + + + + + None + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Open-AzSurveyLink + +Opening the default browser to https://aka.ms/azpssurvey?Q_CHL=INTERCEPT + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/open-azsurveylink + + + + + + Register-AzModule + Register + AzModule + + FOR INTERNAL USE ONLY - Provide Runtime Support for AutoRest Generated cmdlets + + + + FOR INTERNAL USE ONLY - Provide Runtime Support for AutoRest Generated cmdlets + + + + Register-AzModule + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Register-AzModule + + Used Internally by AutoRest-generated cmdlets + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/register-azmodule + + + + + + Remove-AzContext + Remove + AzContext + + Remove a context from the set of available contexts + + + + Remove an azure context from the set of contexts + + + + Remove-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the removed context + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Remove-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return the removed context + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Name + + The name of the context + + System.String + + System.String + + + None + + + PassThru + + Return the removed context + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Remove-AzContext -Name Default + + Remove the context named default + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/remove-azcontext + + + + + + Remove-AzEnvironment + Remove + AzEnvironment + + Removes endpoints and metadata for connecting to a given Azure instance. + + + + The Remove-AzEnvironment cmdlet removes endpoints and metadata information for connecting to a given Azure instance. + + + + Remove-AzEnvironment + + Name + + Specifies the name of the environment to remove. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Name + + Specifies the name of the environment to remove. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and removing a test environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Remove-AzEnvironment -Name TestEnvironment + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + + This example shows how to create an environment using Add-AzEnvironment, and then how to delete the environment using Remove-AzEnvironment. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/remove-azenvironment + + + Add-AzEnvironment + + + + Get-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Rename-AzContext + Rename + AzContext + + Rename an Azure context. By default contexts are named by user account and subscription. + + + + Rename an Azure context. By default contexts are named by user account and subscription. + + + + Rename-AzContext + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the renamed context. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Rename-AzContext + + SourceName + + The name of the context + + System.String + + System.String + + + None + + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return the renamed context. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the renamed context. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SourceName + + The name of the context + + System.String + + System.String + + + None + + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ------ Example 1: Rename a context using named parameters ------ + Rename-AzContext -SourceName "[user1@contoso.org; 12345-6789-2345-3567890]" -TargetName "Work" + + Rename the context for 'user1@contoso.org' with subscription '12345-6789-2345-3567890' to 'Work'. After this command, you will be able to target the context using 'Select-AzContext Work'. Note that you can tab through the values for 'SourceName' using tab completion. + + + + + + --- Example 2: Rename a context using positional parameters --- + Rename-AzContext "My context" "Work" + + Rename the context named "My context" to "Work". After this command, you will be able to target the context using Select-AzContext Work + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/rename-azcontext + + + + + + Resolve-AzError + Resolve + AzError + + Display detailed information about PowerShell errors, with extended details for Azure PowerShell errors. + + + + Resolves and displays detailed information about errors in the current PowerShell session, including where the error occurred in script, stack trace, and all inner and aggregate exceptions. For Azure PowerShell errors provides additional detail in debugging service issues, including complete detail about the request and server response that caused the error. + + + + Resolve-AzError + + Error + + One or more error records to resolve. If no parameters are specified, all errors in the session are resolved. + + System.Management.Automation.ErrorRecord[] + + System.Management.Automation.ErrorRecord[] + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + Resolve-AzError + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Last + + Resolve only the last error that occurred in the session. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Error + + One or more error records to resolve. If no parameters are specified, all errors in the session are resolved. + + System.Management.Automation.ErrorRecord[] + + System.Management.Automation.ErrorRecord[] + + + None + + + Last + + Resolve only the last error that occurred in the session. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.ErrorRecord[] + + + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + + + + + + + + + + + + + -------------- Example 1: Resolve the Last Error -------------- + Resolve-AzError -Last + +HistoryId: 3 + + +Message : Run Connect-AzAccount to login. +StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in AzureRmCmdlet.cs:line 85 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in AzureRmCmdlet.cs:line 269 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() inAzurePSCmdlet.cs:line 299 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in AzureRmCmdlet.cs:line 320 + at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in GetAzureRMSubscription.cs:line 49 + at System.Management.Automation.Cmdlet.DoBeginProcessing() + at System.Management.Automation.CommandProcessorBase.DoBegin() +Exception : System.Management.Automation.PSInvalidOperationException +InvocationInfo : {Get-AzSubscription} +Line : Get-AzSubscription +Position : At line:1 char:1 + + Get-AzSubscription + + ~~~~~~~~~~~~~~~~~~~~~~~ +HistoryId : 3 + + Get details of the last error. + + + + + + --------- Example 2: Resolve all Errors in the Session --------- + Resolve-AzError + +HistoryId: 8 + + +RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d +Message : Resource group 'contoso' could not be found. +ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found. + (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError]) +ServerResponse : {NotFound} +RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co + ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01} +InvocationInfo : {Get-AzStorageAccount} +Line : Get-AzStorageAccount -ResourceGroupName contoso -Name contoso +Position : At line:1 char:1 + + Get-AzStorageAccount -ResourceGroupName contoso -Name contoso + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync + >d__8.MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7. + MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc + ountsOperations operations, String resourceGroupName, String accountName) + at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\ + zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto + rageAccount.cs:line 70 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642 +HistoryId : 8 + + + HistoryId: 5 + + +Message : Run Connect-AzAccount to login. +StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in C:\zd\azur + e-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 85 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in + C:\zd\azure-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:lin + e 269 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 299 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in C:\zd\azure-p + owershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 320 + at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in C:\zd\azure- + powershell\src\ResourceManager\Profile\Commands.Profile\Subscription\GetAzureRMSubscription.cs:line 49 + at System.Management.Automation.Cmdlet.DoBeginProcessing() + at System.Management.Automation.CommandProcessorBase.DoBegin() +Exception : System.Management.Automation.PSInvalidOperationException +InvocationInfo : {Get-AzSubscription} +Line : Get-AzSubscription +Position : At line:1 char:1 + + Get-AzSubscription + + ~~~~~~~~~~~~~~~~~~~~~~~ +HistoryId : 5 + + Get details of all errors that have occurred in the current session. + + + + + + ------------- Example 3: Resolve a Specific Error ------------- + Resolve-AzError $Error[0] + +HistoryId: 8 + + +RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d +Message : Resource group 'contoso' could not be found. +ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found. + (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError]) +ServerResponse : {NotFound} +RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co + ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01} +InvocationInfo : {Get-AzStorageAccount} +Line : Get-AzStorageAccount -ResourceGroupName contoso -Name contoso +Position : At line:1 char:1 + + Get-AzStorageAccount -ResourceGroupName contoso -Name contoso + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync + >d__8.MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7. + MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc + ountsOperations operations, String resourceGroupName, String accountName) + at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\ + zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto + rageAccount.cs:line 70 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642 +HistoryId : 8 + + Get details of the specified error. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/resolve-azerror + + + + + + Save-AzContext + Save + AzContext + + Saves the current authentication information for use in other PowerShell sessions. + + + + The Save-AzContext cmdlet saves the current authentication information for use in other PowerShell sessions. + + + + Save-AzContext + + Profile + + Specifies the Azure context from which this cmdlet reads. If you do not specify a context, this cmdlet reads from the local default context. + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + Path + + Specifies the path of the file to which to save authentication information. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrite the given file if it exists + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrite the given file if it exists + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Path + + Specifies the path of the file to which to save authentication information. + + System.String + + System.String + + + None + + + Profile + + Specifies the Azure context from which this cmdlet reads. If you do not specify a context, this cmdlet reads from the local default context. + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ------- Example 1: Saving the current session's context ------- + Connect-AzAccount +Save-AzContext -Path C:\test.json + + This example saves the current session's Azure context to the JSON file provided. + + + + + + -------------- Example 2: Saving a given context -------------- + Save-AzContext -Profile (Connect-AzAccount) -Path C:\test.json + + This example saves the Azure context that is passed through to the cmdlet to the JSON file provided. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/save-azcontext + + + + + + Select-AzContext + Select + AzContext + + Select a subscription and account to target in Azure PowerShell cmdlets + + + + Select a subscription to target (or account or tenant) in Azure PowerShell cmdlets. After this cmdlet, future cmdlets will target the selected context. + + + + Select-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Select-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Name + + The name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + -------------- Example 1: Target a named context -------------- + Select-AzContext "Work" + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + Target future Azure PowerShell cmdlets at the account, tenant, and subscription in the 'Work' context. + + + + + + -------------------------- Example 2 -------------------------- + Select-AzContext -Name TestEnvironment -Scope Process + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/select-azcontext + + + + + + Send-Feedback + Send + Feedback + + Sends feedback to the Azure PowerShell team via a set of guided prompts. + + + + The Send-Feedback cmdlet sends feedback to the Azure PowerShell team. + + + + Send-Feedback + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + -------------------------- Example 1: -------------------------- + Send-Feedback + +With zero (0) being the least and ten (10) being the most, how likely are you to recommend Azure PowerShell to a friend or colleague? + +10 + +What does Azure PowerShell do well? + +Response. + +Upon what could Azure PowerShell improve? + +Response. + +Please enter your email if you are interested in providing follow up information: + +your@email.com + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/send-feedback + + + + + + Set-AzContext + Set + AzContext + + Sets the tenant, subscription, and environment for cmdlets to use in the current session. + + + + The Set-AzContext cmdlet sets authentication information for cmdlets that you run in the current session. The context includes tenant, subscription, and environment information. + + + + Set-AzContext + + Context + + Specifies the context for the current session. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + Subscription + + The name or id of the subscription that the context should be set to. This parameter has aliases to -SubscriptionName and -SubscriptionId, so, for clarity, either of these can be used instead of -Subscription when specifying name and id, respectively. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + SubscriptionObject + + A subscription object + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + TenantObject + + A Tenant Object + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Context + + Specifies the context for the current session. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Subscription + + The name or id of the subscription that the context should be set to. This parameter has aliases to -SubscriptionName and -SubscriptionId, so, for clarity, either of these can be used instead of -Subscription when specifying name and id, respectively. + + System.String + + System.String + + + None + + + SubscriptionObject + + A subscription object + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + TenantObject + + A Tenant Object + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ----------- Example 1: Set the subscription context ----------- + Set-AzContext -Subscription "xxxx-xxxx-xxxx-xxxx" + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + This command sets the context to use the specified subscription. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/set-azcontext + + + Get-AzContext + + + + + + + Set-AzDefault + Set + AzDefault + + Sets a default in the current context + + + + The Set-AzDefault cmdlet adds or changes the defaults in the current context. + + + + Set-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Create a new resource group if specified default does not exist + + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroupName + + Name of the resource group being set as default + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Create a new resource group if specified default does not exist + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroupName + + Name of the resource group being set as default + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSResourceGroup + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Set-AzDefault -ResourceGroupName myResourceGroup + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command sets the default resource group to the resource group specified by the user. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/set-azdefault + + + + + + Set-AzEnvironment + Set + AzEnvironment + + Sets properties for an Azure environment. + + + + The Set-AzEnvironment cmdlet sets endpoints and metadata for connecting to an instance of Azure. + + + + Set-AzEnvironment + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + + System.Management.Automation.SwitchParameter + + + False + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. The parameter is to set the value to `GalleryUrl` of `PSAzureEnvironment`. As `GalleryUrl` is removed from ArmMetadata, Azure PowerShell will no longer provide for the value and so it is not recommended to set `GalleryEndpoint` anymore. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzEnvironment + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. The parameter is to set the value to `GalleryUrl` of `PSAzureEnvironment`. As `GalleryUrl` is removed from ArmMetadata, Azure PowerShell will no longer provide for the value and so it is not recommended to set `GalleryEndpoint` anymore. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and modifying a new environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Set-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint NewTestADEndpoint ` + -GraphEndpoint NewTestGraphEndpoint | Format-List + +Name : TestEnvironment +EnableAdfsAuthentication : False +ActiveDirectoryServiceEndpointResourceId : TestADApplicationId +AdTenant : +GalleryUrl : TestGalleryEndpoint +ManagementPortalUrl : +ServiceManagementUrl : +PublishSettingsFileUrl : +ResourceManagerUrl : TestRMEndpoint +SqlDatabaseDnsSuffix : +StorageEndpointSuffix : +ActiveDirectoryAuthority : NewTestADEndpoint +GraphUrl : NewTestGraphEndpoint +GraphEndpointResourceId : +TrafficManagerDnsSuffix : +AzureKeyVaultDnsSuffix : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : +BatchEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureOperationalInsightsEndpointResourceId : +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : +AzureSynapseAnalyticsEndpointResourceId : + + In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/set-azenvironment + + + Add-AzEnvironment + + + + Get-AzEnvironment + + + + Remove-AzEnvironment + + + + + + + Uninstall-AzureRm + Uninstall + AzureRm + + Removes all AzureRm modules from a machine. + + + + Removes all AzureRm modules from a machine. + + + + Uninstall-AzureRm + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Return list of Modules removed if specified. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Return list of Modules removed if specified. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Uninstall-AzureRm + + Running this command will remove all AzureRm modules from the machine for the version of PowerShell in which the cmdlet is run. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/uninstall-azurerm + + + + + + Update-AzConfig + Update + AzConfig + + Updates the configs of Azure PowerShell. + + + + Updates the configs of Azure PowerShell. Depending on which config to update, you may specify the scope where the config is persisted and to which module or cmdlet it applies to. + > [!NOTE] > It is discouraged to update configs in multiple PowerShell processes. Either do it in one process, or make sure the updates are at Process scope (`-Scope Process`) to avoid unexpected side-effects. + + + + Update-AzConfig + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + System.Boolean + + System.Boolean + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + System.String + + System.String + + + None + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + System.Boolean + + System.Boolean + + + None + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + System.Boolean + + System.Boolean + + + None + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + System.Boolean + + System.Boolean + + + None + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + System.Boolean + + System.Boolean + + + None + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + System.Boolean + + System.Boolean + + + None + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + System.Boolean + + System.Boolean + + + None + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + + CurrentUser + Process + Default + Environment + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + System.Boolean + + System.Boolean + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + System.String + + System.String + + + None + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + System.Boolean + + System.Boolean + + + None + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + System.Boolean + + System.Boolean + + + None + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + System.Boolean + + System.Boolean + + + None + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + System.Boolean + + System.Boolean + + + None + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + System.Boolean + + System.Boolean + + + None + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + System.Boolean + + System.Boolean + + + None + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Boolean + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSConfig + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Update-AzConfig -DefaultSubscriptionForLogin "Name of subscription" + +Key Value Applies To Scope Help Message +--- ----- ---------- ----- ------------ +DefaultSubscriptionForLogin Name of subscription Az CurrentUser Subscription name or GUID. Sets the default context for Azure PowerShell when lo… + + Sets the "DefaultSubscriptionForLogin" config as "Name of subscription". When `Connect-AzAccount` the specified subscription will be selected as the default subscription. + + + + + + -------------------------- Example 2 -------------------------- + Update-AzConfig -DisplayBreakingChangeWarning $false -AppliesTo "Az.KeyVault" + +Key Value Applies To Scope Help Message +--- ----- ---------- ----- ------------ +DisplayBreakingChangeWarning False Az.KeyVault CurrentUser Controls if warning messages for breaking changes are displayed or suppressed. When enabled,… + + Sets the "DisplayBreakingChangeWarnings" config as "$false" for "Az.KeyVault" module. This prevents all the warning messages for upcoming breaking changes in Az.KeyVault module from prompting. + + + + + + -------------------------- Example 3 -------------------------- + Update-AzConfig -EnableDataCollection $true + +Key Value Applies To Scope Help Message +--- ----- ---------- ----- ------------ +EnableDataCollection True Az CurrentUser When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experi… + + Sets the "EnableDataCollection" config as "$true". This enables sending the telemetry data. Setting this config is equivalent to `Enable-AzDataCollection` and `Disable-AzDataCollection`. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/update-azconfig + + + + \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.Share.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.Share.dll new file mode 100644 index 000000000000..3d53eaa669dc Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.Share.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.dll new file mode 100644 index 000000000000..2443eb5dd56a Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Storage.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Storage.dll new file mode 100644 index 000000000000..a163f556b3f8 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Storage.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Strategies.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Strategies.dll new file mode 100644 index 000000000000..0ccbb5ead102 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Strategies.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.Azure.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.Azure.dll new file mode 100644 index 000000000000..1d99c7015912 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.Azure.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.dll new file mode 100644 index 000000000000..a4fca7488baf Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.DataMovement.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.DataMovement.dll new file mode 100644 index 000000000000..6ac672abd486 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.DataMovement.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.dll new file mode 100644 index 000000000000..70c5ed6806c6 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/PostImportScripts/LoadAuthenticators.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/PostImportScripts/LoadAuthenticators.ps1 new file mode 100644 index 000000000000..1a6de8a08d69 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/PostImportScripts/LoadAuthenticators.ps1 @@ -0,0 +1,222 @@ +if ($PSEdition -eq 'Desktop') { + try { + [Microsoft.Azure.Commands.Profile.Utilities.CustomAssemblyResolver]::Initialize() + } catch {} +} +# SIG # Begin signature block +# MIIoPAYJKoZIhvcNAQcCoIIoLTCCKCkCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBn8ROze2QLH/c6 +# GtPhR/BPLgOtmjkNhcq+fFmu16VcrqCCDYUwggYDMIID66ADAgECAhMzAAADTU6R +# phoosHiPAAAAAANNMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI4WhcNMjQwMzE0MTg0MzI4WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDUKPcKGVa6cboGQU03ONbUKyl4WpH6Q2Xo9cP3RhXTOa6C6THltd2RfnjlUQG+ +# Mwoy93iGmGKEMF/jyO2XdiwMP427j90C/PMY/d5vY31sx+udtbif7GCJ7jJ1vLzd +# j28zV4r0FGG6yEv+tUNelTIsFmmSb0FUiJtU4r5sfCThvg8dI/F9Hh6xMZoVti+k +# bVla+hlG8bf4s00VTw4uAZhjGTFCYFRytKJ3/mteg2qnwvHDOgV7QSdV5dWdd0+x +# zcuG0qgd3oCCAjH8ZmjmowkHUe4dUmbcZfXsgWlOfc6DG7JS+DeJak1DvabamYqH +# g1AUeZ0+skpkwrKwXTFwBRltAgMBAAGjggGCMIIBfjAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUId2Img2Sp05U6XI04jli2KohL+8w +# VAYDVR0RBE0wS6RJMEcxLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEWMBQGA1UEBRMNMjMwMDEyKzUwMDUxNzAfBgNVHSMEGDAW +# gBRIbmTlUAXTgqoXNzcitW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8v +# d3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIw +# MTEtMDctMDguY3JsMGEGCCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDov +# L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDEx +# XzIwMTEtMDctMDguY3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIB +# ACMET8WuzLrDwexuTUZe9v2xrW8WGUPRQVmyJ1b/BzKYBZ5aU4Qvh5LzZe9jOExD +# YUlKb/Y73lqIIfUcEO/6W3b+7t1P9m9M1xPrZv5cfnSCguooPDq4rQe/iCdNDwHT +# 6XYW6yetxTJMOo4tUDbSS0YiZr7Mab2wkjgNFa0jRFheS9daTS1oJ/z5bNlGinxq +# 2v8azSP/GcH/t8eTrHQfcax3WbPELoGHIbryrSUaOCphsnCNUqUN5FbEMlat5MuY +# 94rGMJnq1IEd6S8ngK6C8E9SWpGEO3NDa0NlAViorpGfI0NYIbdynyOB846aWAjN +# fgThIcdzdWFvAl/6ktWXLETn8u/lYQyWGmul3yz+w06puIPD9p4KPiWBkCesKDHv +# XLrT3BbLZ8dKqSOV8DtzLFAfc9qAsNiG8EoathluJBsbyFbpebadKlErFidAX8KE +# usk8htHqiSkNxydamL/tKfx3V/vDAoQE59ysv4r3pE+zdyfMairvkFNNw7cPn1kH +# Gcww9dFSY2QwAxhMzmoM0G+M+YvBnBu5wjfxNrMRilRbxM6Cj9hKFh0YTwba6M7z +# ntHHpX3d+nabjFm/TnMRROOgIXJzYbzKKaO2g1kWeyG2QtvIR147zlrbQD4X10Ab +# rRg9CpwW7xYxywezj+iNAc+QmFzR94dzJkEPUSCJPsTFMIIHejCCBWKgAwIBAgIK +# YQ6Q0gAAAAAAAzANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlm +# aWNhdGUgQXV0aG9yaXR5IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEw +# OTA5WjB+MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYD +# VQQDEx9NaWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG +# 9w0BAQEFAAOCAg8AMIICCgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+la +# UKq4BjgaBEm6f8MMHt03a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc +# 6Whe0t+bU7IKLMOv2akrrnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4D +# dato88tt8zpcoRb0RrrgOGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+ +# lD3v++MrWhAfTVYoonpy4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nk +# kDstrjNYxbc+/jLTswM9sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6 +# A4aN91/w0FK/jJSHvMAhdCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmd +# X4jiJV3TIUs+UsS1Vz8kA/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL +# 5zmhD+kjSbwYuER8ReTBw3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zd +# sGbiwZeBe+3W7UvnSSmnEyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3 +# T8HhhUSJxAlMxdSlQy90lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS +# 4NaIjAsCAwEAAaOCAe0wggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRI +# bmTlUAXTgqoXNzcitW2oynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTAL +# BgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBD +# uRQFTuHqp8cx0SOJNDBaBgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jv +# c29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3JsMF4GCCsGAQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3J0MIGfBgNVHSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEF +# BQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1h +# cnljcHMuaHRtMEAGCCsGAQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkA +# YwB5AF8AcwB0AGEAdABlAG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn +# 8oalmOBUeRou09h0ZyKbC5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7 +# v0epo/Np22O/IjWll11lhJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0b +# pdS1HXeUOeLpZMlEPXh6I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/ +# KmtYSWMfCWluWpiW5IP0wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvy +# CInWH8MyGOLwxS3OW560STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBp +# mLJZiWhub6e3dMNABQamASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJi +# hsMdYzaXht/a8/jyFqGaJ+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYb +# BL7fQccOKO7eZS/sl/ahXJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbS +# oqKfenoi+kiVH6v7RyOA9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sL +# gOppO6/8MO0ETI7f33VtY5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtX +# cVZOSEXAQsmbdlsKgEhr/Xmfwb1tbWrJUnMTDXpQzTGCGg0wghoJAgEBMIGVMH4x +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01p +# Y3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTECEzMAAANNTpGmGiiweI8AAAAA +# A00wDQYJYIZIAWUDBAIBBQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQw +# HAYKKwYBBAGCNwIBCzEOMAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIC8M +# Xy0xGn+XGeN5xhSUhsVdQGTLtuHOS5+U3UgQ1k53MEIGCisGAQQBgjcCAQwxNDAy +# oBSAEgBNAGkAYwByAG8AcwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20wDQYJKoZIhvcNAQEBBQAEggEAf/y9IwVq9QTOrbQE7i6AVISmUE6gxgH9PaqX +# D6xL8+9cpj9Y6/kfZ6Zw1Z04+XY4c5dhmIJuWcRjx+i5yXFmp0fyaDfNpalcQlJv +# 1yplKVfyAsVpod7RIH4YvrwP2c/gvYSLRF9k1a/QyIT4yTfPFGaR42tZ0MAyWHhz +# t5ZdXN3dPJt865YoEzv7pPZN29w4mjfr78s6XxeYYARLHPdw/rChVioeia9TyNl9 +# QCKfm9Kar9oDLel2pMgRuonn40KhF85e93XvVLO1PMGXzljlkGWY7PmHuXiOJeyS +# xOe/+p56sTLtL2yIjl/8SDLVGi7LJ7Y93hQGv9yd8U9Tio/mVqGCF5cwgheTBgor +# BgEEAYI3AwMBMYIXgzCCF38GCSqGSIb3DQEHAqCCF3AwghdsAgEDMQ8wDQYJYIZI +# AWUDBAIBBQAwggFSBgsqhkiG9w0BCRABBKCCAUEEggE9MIIBOQIBAQYKKwYBBAGE +# WQoDATAxMA0GCWCGSAFlAwQCAQUABCAkPO6Va7JVENY1DGO3Rgl+LBuXva2N4CJh +# CxPTspOx1QIGZQP2LMVBGBMyMDIzMDkyMDA1NTA0NC41MDZaMASAAgH0oIHRpIHO +# MIHLMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH +# UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQL +# ExxNaWNyb3NvZnQgQW1lcmljYSBPcGVyYXRpb25zMScwJQYDVQQLEx5uU2hpZWxk +# IFRTUyBFU046OEQwMC0wNUUwLUQ5NDcxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1l +# LVN0YW1wIFNlcnZpY2WgghHtMIIHIDCCBQigAwIBAgITMwAAAc1VByrnysGZHQAB +# AAABzTANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2Fz +# aGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENv +# cnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAx +# MDAeFw0yMzA1MjUxOTEyMDVaFw0yNDAyMDExOTEyMDVaMIHLMQswCQYDVQQGEwJV +# UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UE +# ChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQLExxNaWNyb3NvZnQgQW1l +# cmljYSBPcGVyYXRpb25zMScwJQYDVQQLEx5uU2hpZWxkIFRTUyBFU046OEQwMC0w +# NUUwLUQ5NDcxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2Uw +# ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDTOCLVS2jmEWOqxzygW7s6 +# YLmm29pjvA+Ch6VL7HlTL8yUt3Z0KIzTa2O/Hvr/aJza1qEVklq7NPiOrpBAIz65 +# 7LVxwEc4BxJiv6B68a8DQiF6WAFFNaK3WHi7TfxRnqLohgNz7vZPylZQX795r8MQ +# vX56uwjj/R4hXnR7Na4Llu4mWsml/wp6VJqCuxZnu9jX4qaUxngcrfFT7+zvlXCl +# wLah2n0eGKna1dOjOgyK00jYq5vtzr5NZ+qVxqaw9DmEsj9vfqYkfQZry2JO5wmg +# XX79Ox7PLMUfqT4+8w5JkdSMoX32b1D6cDKWRUv5qjiYh4o/a9ehE/KAkUWlSPbb +# DR/aGnPJLAGPy2qA97YCBeeIJjRKURgdPlhE5O46kOju8nYJnIvxbuC2Qp2jxwc6 +# rD9M6Pvc8sZIcQ10YKZVYKs94YPSlkhwXwttbRY+jZnQiDm2ZFjH8SPe1I6ERcfe +# YX1zCYjEzdwWcm+fFZmlJA9HQW7ZJAmOECONtfK28EREEE5yzq+T3QMVPhiEfEhg +# cYsh0DeoWiYGsDiKEuS+FElMMyT456+U2ZRa2hbRQ97QcbvaAd6OVQLp3TQqNEu0 +# es5Zq0wg2CADf+QKQR/Y6+fGgk9qJNJW3Mu771KthuPlNfKss0B1zh0xa1yN4qC3 +# zoE9Uq6T8r7G3/OtSFms4wIDAQABo4IBSTCCAUUwHQYDVR0OBBYEFKGT+aY2aZrB +# AJVIZh5kicokfNWaMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMF8G +# A1UdHwRYMFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMv +# Y3JsL01pY3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNybDBs +# BggrBgEFBQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cubWljcm9zb2Z0 +# LmNvbS9wa2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUy +# MDIwMTAoMSkuY3J0MAwGA1UdEwEB/wQCMAAwFgYDVR0lAQH/BAwwCgYIKwYBBQUH +# AwgwDgYDVR0PAQH/BAQDAgeAMA0GCSqGSIb3DQEBCwUAA4ICAQBSqG3ppKIU+i/E +# MwwtotoxnKfw0SX/3T16EPbjwsAImWOZ5nLAbatopl8zFY841gb5eiL1j81h4DiE +# iXt+BJgHIA2LIhKhSscd79oMbr631DiEqf9X5LZR3V3KIYstU3K7f5Dk7tbobuHu +# +6fYM/gOx44sgRU7YQ+YTYHvv8k4mMnuiahJRlU/F2vavcHU5uhXi078K4nSRAPn +# WyX7gVi6iVMBBUF4823oPFznEcHup7VNGRtGe1xvnlMd1CuyxctM8d/oqyTsxwlJ +# AM5F/lDxnEWoSzAkad1nWvkaAeMV7+39IpXhuf9G3xbffKiyBnj3cQeiA4SxSwCd +# nx00RBlXS6r9tGDa/o9RS01FOABzKkP5CBDpm4wpKdIU74KtBH2sE5QYYn7liYWZ +# r2f/U+ghTmdOEOPkXEcX81H4dRJU28Tj/gUZdwL81xah8Kn+cB7vM/Hs3/J8tF13 +# ZPP+8NtX3vu4NrchHDJYgjOi+1JuSf+4jpF/pEEPXp9AusizmSmkBK4iVT7NwVtR +# nS1ts8qAGHGPg2HPa4b2u9meueUoqNVtMhbumI1y+d9ZkThNXBXz2aItT2C99DM3 +# T3qYqAUmvKUryVSpMLVpse4je5WN6VVlCDFKWFRH202YxEVWsZ5baN9CaqCbCS0E +# a7s9OFLaEM5fNn9m5s69lD/ekcW2qTCCB3EwggVZoAMCAQICEzMAAAAVxedrngKb +# SZkAAAAAABUwDQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmlj +# YXRlIEF1dGhvcml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIy +# NVowfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT +# B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UE +# AxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXI +# yjVX9gF/bErg4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjo +# YH1qUoNEt6aORmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1y +# aa8dq6z2Nr41JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v +# 3byNpOORj7I5LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pG +# ve2krnopN6zL64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viS +# kR4dPf0gz3N9QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYr +# bqgSUei/BQOj0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlM +# jgK8QmguEOqEUUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSL +# W6CmgyFdXzB0kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AF +# emzFER1y7435UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIu +# rQIDAQABo4IB3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIE +# FgQUKqdS/mTEmr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWn +# G1M1GelyMFwGA1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEW +# M2h0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5 +# Lmh0bTATBgNVHSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBi +# AEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV +# 9lbLj+iiXGJo0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3Js +# Lm1pY3Jvc29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAx +# MC0wNi0yMy5jcmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8v +# d3d3Lm1pY3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2 +# LTIzLmNydDANBgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv +# 6lwUtj5OR2R4sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZn +# OlNN3Zi6th542DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1 +# bSNU5HhTdSRXud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4 +# rPf5KYnDvBewVIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU +# 6ZGyqVvfSaN0DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDF +# NLB62FD+CljdQDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/ +# HltEAY5aGZFrDZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdU +# CbFpAUR+fKFhbHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKi +# excdFYmNcP7ntdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTm +# dHRbatGePu1+oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZq +# ELQdVTNYs6FwZvKhggNQMIICOAIBATCB+aGB0aSBzjCByzELMAkGA1UEBhMCVVMx +# EzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoT +# FU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJp +# Y2EgT3BlcmF0aW9uczEnMCUGA1UECxMeblNoaWVsZCBUU1MgRVNOOjhEMDAtMDVF +# MC1EOTQ3MSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFtcCBTZXJ2aWNloiMK +# AQEwBwYFKw4DAhoDFQBoqfem2KKzuRZjISYifGolVOdyBKCBgzCBgKR+MHwxCzAJ +# BgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25k +# MR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jv +# c29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwMA0GCSqGSIb3DQEBCwUAAgUA6LRjDzAi +# GA8yMDIzMDkxOTE4MTIzMVoYDzIwMjMwOTIwMTgxMjMxWjB3MD0GCisGAQQBhFkK +# BAExLzAtMAoCBQDotGMPAgEAMAoCAQACAhpaAgH/MAcCAQACAhNWMAoCBQDotbSP +# AgEAMDYGCisGAQQBhFkKBAIxKDAmMAwGCisGAQQBhFkKAwKgCjAIAgEAAgMHoSCh +# CjAIAgEAAgMBhqAwDQYJKoZIhvcNAQELBQADggEBALTbRIUnATvJxQER3PTF/m7f +# ea2mmC38vdy89JNDWbAETiN+HOhqZRgyGz1otnOANH++7NjRRSrh8byXARE8w1dN +# AVpbbjDea3JZt2zTkA6uRN/vjuifXHSz470WR6P8Mm3KhMtOK4AYLam5Xe1bnjAv +# JU02cI0r1MUOqkWJa/2Il+9Dm1raxizVGFUvgSLHDgxpFgfins0MBOg4RQTpRDIP +# arFUPTmbFhZfTBa2DAiHGcy9hPO1pNUY3FKdAMYkRxt9CAodlmkueGu6oiSxRd3M +# TPqGHQx9pJzJuE6yM0SZO/J0O5PnHIRc7RMdy0XikWk8D3SmDYFQOOxk7noeloYx +# ggQNMIIECQIBATCBkzB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3Rv +# bjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0 +# aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAA +# Ac1VByrnysGZHQABAAABzTANBglghkgBZQMEAgEFAKCCAUowGgYJKoZIhvcNAQkD +# MQ0GCyqGSIb3DQEJEAEEMC8GCSqGSIb3DQEJBDEiBCDMuF7QDQHme8LEs4NWCnOa +# 8jbgJtGZELxoEEYiDH+efzCB+gYLKoZIhvcNAQkQAi8xgeowgecwgeQwgb0EIOJm +# pfitVr1PZGgvTEdTpStUc6GNh7LNroQBKwpURpkKMIGYMIGApH4wfDELMAkGA1UE +# BhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAc +# BgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0 +# IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAHNVQcq58rBmR0AAQAAAc0wIgQgpXNo +# CR5udEHFtsK4vRweYQG6+tUY8EhPATlSEIELPDswDQYJKoZIhvcNAQELBQAEggIA +# iFTcLZ0vwFJzK+Rqanq7AynGwJuFJLGY6whQgWb+a8jLVtlCBrd5w36Xa3DfTbUO +# KSNVOq3JahGUSLZwnfm69YOiH8xujOMozBs7lgnTwoEfFchjFhGxMUxjC7YVuqph +# 82Q6e/qzSHMhNsbVoL7G/EA9lGIQ2rjxiREnh5IbiAvrrYyYrIHUGux7U/gXUE3W +# UzXMCNAuQrAXgC1I4CRfv8gRR1D1Zf27juawIsubcJ+X4NsHsrZlUChB4Jvcli5U +# +0BHtqXZl0jesLtdnxXcZQrZR8N5yMAr+J9ozW4F5l/Nw/K3JO/5XeR3tGjTpKWT +# qd9YPyvhJpn7WJGeOb60ahoyNkCPjdJXCfx7tMRYztCzlQVkqsbZmaWXAOPBpCJy +# KJW7TTHceNGuQxTbZ62LPX+3X+Li0I5QL+fN/CyvajxlbkONe6p7mEO1GwyEoBHK +# aK7p3pH45Fyn9pedZpWRnwNKFCtm7xIGrjD8dwh/SKnQQn0UZCOm6Z2MTA2dexh5 +# tckF0e9H6wsS2ty7bQjaxuIu7bRVIOv7N58yLZvZ/JpjuxTXTxJuxPmlAsBq4DPk +# 6oHV7zY0K9mbyoGUw0Hie5ZW+i15UGOQYjt9ORg38GLgv4mt3o4v78J0X1HTWDGt +# IKZzmt/ZsnE2gTde52Wujm56LnstUoCXuTKlLP5MTGA= +# SIG # End signature block diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/AzError.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/AzError.ps1 new file mode 100644 index 000000000000..5379b99cf34a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/AzError.ps1 @@ -0,0 +1,281 @@ +function Write-InstallationCheckToFile +{ + Param($installationchecks) + if (Get-Module AzureRM.Profile -ListAvailable -ErrorAction Ignore) + { + Write-Warning ("Both Az and AzureRM modules were detected on this machine. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide") + } + + $installationchecks.Add("AzSideBySideCheck","true") + try + { + if (Test-Path $pathToInstallationChecks -ErrorAction Ignore) + { + Remove-Item -Path $pathToInstallationChecks -ErrorAction Stop + } + + $pathToInstallDir = Split-Path -Path $pathToInstallationChecks -Parent -ErrorAction Stop + if (Test-Path $pathToInstallDir -ErrorAction Ignore) + { + New-Item -Path $pathToInstallationChecks -ErrorAction Stop -ItemType File -Value ($installationchecks | ConvertTo-Json -ErrorAction Stop) + } + } + catch + { + Write-Verbose "Installation checks failed to write to file." + } +} + +if (!($env:SkipAzInstallationChecks -eq "true")) +{ + $pathToInstallationChecks = Join-Path (Join-Path $HOME ".Azure") "AzInstallationChecks.json" + $installationchecks = @{} + if (!(Test-Path $pathToInstallationChecks -ErrorAction Ignore)) + { + Write-InstallationCheckToFile $installationchecks + } + else + { + try + { + ((Get-Content $pathToInstallationChecks -ErrorAction Stop) | ConvertFrom-Json -ErrorAction Stop).PSObject.Properties | Foreach { $installationchecks[$_.Name] = $_.Value } + } + catch + { + Write-InstallationCheckToFile $installationchecks + } + + if (!$installationchecks.ContainsKey("AzSideBySideCheck")) + { + Write-InstallationCheckToFile $installationchecks + } + } +} + +if (Get-Module AzureRM.profile -ErrorAction Ignore) +{ + Write-Warning ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") + throw ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") +} + +Update-TypeData -AppendPath (Join-Path (Get-Item $PSScriptRoot).Parent.FullName Accounts.types.ps1xml) -ErrorAction Ignore +# SIG # Begin signature block +# MIIoPAYJKoZIhvcNAQcCoIIoLTCCKCkCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDT3s8rOGw0kP8l +# AbYXJ7G9hr2fOKBRtW5xO6fWVEOZvqCCDYUwggYDMIID66ADAgECAhMzAAADTU6R +# phoosHiPAAAAAANNMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI4WhcNMjQwMzE0MTg0MzI4WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDUKPcKGVa6cboGQU03ONbUKyl4WpH6Q2Xo9cP3RhXTOa6C6THltd2RfnjlUQG+ +# Mwoy93iGmGKEMF/jyO2XdiwMP427j90C/PMY/d5vY31sx+udtbif7GCJ7jJ1vLzd +# j28zV4r0FGG6yEv+tUNelTIsFmmSb0FUiJtU4r5sfCThvg8dI/F9Hh6xMZoVti+k +# bVla+hlG8bf4s00VTw4uAZhjGTFCYFRytKJ3/mteg2qnwvHDOgV7QSdV5dWdd0+x +# zcuG0qgd3oCCAjH8ZmjmowkHUe4dUmbcZfXsgWlOfc6DG7JS+DeJak1DvabamYqH +# g1AUeZ0+skpkwrKwXTFwBRltAgMBAAGjggGCMIIBfjAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUId2Img2Sp05U6XI04jli2KohL+8w +# VAYDVR0RBE0wS6RJMEcxLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEWMBQGA1UEBRMNMjMwMDEyKzUwMDUxNzAfBgNVHSMEGDAW +# gBRIbmTlUAXTgqoXNzcitW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8v +# d3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIw +# MTEtMDctMDguY3JsMGEGCCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDov +# L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDEx +# XzIwMTEtMDctMDguY3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIB +# ACMET8WuzLrDwexuTUZe9v2xrW8WGUPRQVmyJ1b/BzKYBZ5aU4Qvh5LzZe9jOExD +# YUlKb/Y73lqIIfUcEO/6W3b+7t1P9m9M1xPrZv5cfnSCguooPDq4rQe/iCdNDwHT +# 6XYW6yetxTJMOo4tUDbSS0YiZr7Mab2wkjgNFa0jRFheS9daTS1oJ/z5bNlGinxq +# 2v8azSP/GcH/t8eTrHQfcax3WbPELoGHIbryrSUaOCphsnCNUqUN5FbEMlat5MuY +# 94rGMJnq1IEd6S8ngK6C8E9SWpGEO3NDa0NlAViorpGfI0NYIbdynyOB846aWAjN +# fgThIcdzdWFvAl/6ktWXLETn8u/lYQyWGmul3yz+w06puIPD9p4KPiWBkCesKDHv +# XLrT3BbLZ8dKqSOV8DtzLFAfc9qAsNiG8EoathluJBsbyFbpebadKlErFidAX8KE +# usk8htHqiSkNxydamL/tKfx3V/vDAoQE59ysv4r3pE+zdyfMairvkFNNw7cPn1kH +# Gcww9dFSY2QwAxhMzmoM0G+M+YvBnBu5wjfxNrMRilRbxM6Cj9hKFh0YTwba6M7z +# ntHHpX3d+nabjFm/TnMRROOgIXJzYbzKKaO2g1kWeyG2QtvIR147zlrbQD4X10Ab +# rRg9CpwW7xYxywezj+iNAc+QmFzR94dzJkEPUSCJPsTFMIIHejCCBWKgAwIBAgIK +# YQ6Q0gAAAAAAAzANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlm +# aWNhdGUgQXV0aG9yaXR5IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEw +# OTA5WjB+MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYD +# VQQDEx9NaWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG +# 9w0BAQEFAAOCAg8AMIICCgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+la +# UKq4BjgaBEm6f8MMHt03a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc +# 6Whe0t+bU7IKLMOv2akrrnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4D +# dato88tt8zpcoRb0RrrgOGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+ +# lD3v++MrWhAfTVYoonpy4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nk +# kDstrjNYxbc+/jLTswM9sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6 +# A4aN91/w0FK/jJSHvMAhdCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmd +# X4jiJV3TIUs+UsS1Vz8kA/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL +# 5zmhD+kjSbwYuER8ReTBw3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zd +# sGbiwZeBe+3W7UvnSSmnEyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3 +# T8HhhUSJxAlMxdSlQy90lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS +# 4NaIjAsCAwEAAaOCAe0wggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRI +# bmTlUAXTgqoXNzcitW2oynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTAL +# BgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBD +# uRQFTuHqp8cx0SOJNDBaBgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jv +# c29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3JsMF4GCCsGAQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3J0MIGfBgNVHSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEF +# BQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1h +# cnljcHMuaHRtMEAGCCsGAQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkA +# YwB5AF8AcwB0AGEAdABlAG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn +# 8oalmOBUeRou09h0ZyKbC5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7 +# v0epo/Np22O/IjWll11lhJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0b +# pdS1HXeUOeLpZMlEPXh6I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/ +# KmtYSWMfCWluWpiW5IP0wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvy +# CInWH8MyGOLwxS3OW560STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBp +# mLJZiWhub6e3dMNABQamASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJi +# hsMdYzaXht/a8/jyFqGaJ+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYb +# BL7fQccOKO7eZS/sl/ahXJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbS +# oqKfenoi+kiVH6v7RyOA9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sL +# gOppO6/8MO0ETI7f33VtY5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtX +# cVZOSEXAQsmbdlsKgEhr/Xmfwb1tbWrJUnMTDXpQzTGCGg0wghoJAgEBMIGVMH4x +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01p +# Y3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTECEzMAAANNTpGmGiiweI8AAAAA +# A00wDQYJYIZIAWUDBAIBBQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQw +# HAYKKwYBBAGCNwIBCzEOMAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIKR+ +# w/DaLVp8ra2PXQQVXZI6DyW6fyW+fzmibTR/vTxzMEIGCisGAQQBgjcCAQwxNDAy +# oBSAEgBNAGkAYwByAG8AcwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20wDQYJKoZIhvcNAQEBBQAEggEAAJ/05iL6/mTJTdXlA3WMNU7DPdukKaJDMocn +# pzyB1C0hLB0o81xP7YSAsUBDAKzunfQ+oBNu6n/owxsHxw8C5aiDdeX87DkrwFEN +# 6Y0/kc3H3LpC+ll1Aq78ia85raDdogkMJNqAZOpaSs/+WPQGmTqATI3FTxjzviyB +# W2d09blFshgmPNB4IKNWZrf0xAZjugWcVe7WjbSnrf9C6Uap/yfFjAm1D+Am86Dy +# 9UYWjaxYSdiYj39a4rawSz2+47doMiSNWEdRzLBWQ3mhzG79emCceHwhCMof3KYZ +# WbXjXm+C738l48ZuzZ50X/w2B7jWQCLLiIdIY0Nczh9n7W+R8qGCF5cwgheTBgor +# BgEEAYI3AwMBMYIXgzCCF38GCSqGSIb3DQEHAqCCF3AwghdsAgEDMQ8wDQYJYIZI +# AWUDBAIBBQAwggFSBgsqhkiG9w0BCRABBKCCAUEEggE9MIIBOQIBAQYKKwYBBAGE +# WQoDATAxMA0GCWCGSAFlAwQCAQUABCDTxg5YDL/sFFSkwNmajR/hD+zpUa9/iONc +# c1T6Gn07AgIGZQPtxMFeGBMyMDIzMDkyMDA1NTA0My40MTNaMASAAgH0oIHRpIHO +# MIHLMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH +# UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQL +# ExxNaWNyb3NvZnQgQW1lcmljYSBPcGVyYXRpb25zMScwJQYDVQQLEx5uU2hpZWxk +# IFRTUyBFU046QTAwMC0wNUUwLUQ5NDcxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1l +# LVN0YW1wIFNlcnZpY2WgghHtMIIHIDCCBQigAwIBAgITMwAAAdB3CKrvoxfG3QAB +# AAAB0DANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2Fz +# aGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENv +# cnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAx +# MDAeFw0yMzA1MjUxOTEyMTRaFw0yNDAyMDExOTEyMTRaMIHLMQswCQYDVQQGEwJV +# UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UE +# ChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQLExxNaWNyb3NvZnQgQW1l +# cmljYSBPcGVyYXRpb25zMScwJQYDVQQLEx5uU2hpZWxkIFRTUyBFU046QTAwMC0w +# NUUwLUQ5NDcxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2Uw +# ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDfMlfn35fvM0XAUSmI5qiG +# 0UxPi25HkSyBgzk3zpYO311d1OEEFz0QpAK23s1dJFrjB5gD+SMw5z6EwxC4CrXU +# 9KaQ4WNHqHrhWftpgo3MkJex9frmO9MldUfjUG56sIW6YVF6YjX+9rT1JDdCDHbo +# 5nZiasMigGKawGb2HqD7/kjRR67RvVh7Q4natAVu46Zf5MLviR0xN5cNG20xwBwg +# ttaYEk5XlULaBH5OnXz2eWoIx+SjDO7Bt5BuABWY8SvmRQfByT2cppEzTjt/fs0x +# p4B1cAHVDwlGwZuv9Rfc3nddxgFrKA8MWHbJF0+aWUUYIBR8Fy2guFVHoHeOze7I +# sbyvRrax//83gYqo8c5Z/1/u7kjLcTgipiyZ8XERsLEECJ5ox1BBLY6AjmbgAzDd +# Nl2Leej+qIbdBr/SUvKEC+Xw4xjFMOTUVWKWemt2khwndUfBNR7Nzu1z9L0Wv7TA +# Y/v+v6pNhAeohPMCFJc+ak6uMD8TKSzWFjw5aADkmD9mGuC86yvSKkII4MayzoUd +# seT0nfk8Y0fPjtdw2Wnejl6zLHuYXwcDau2O1DMuoiedNVjTF37UEmYT+oxC/OFX +# UGPDEQt9tzgbR9g8HLtUfEeWOsOED5xgb5rwyfvIss7H/cdHFcIiIczzQgYnsLyE +# GepoZDkKhSMR5eCB6Kcv/QIDAQABo4IBSTCCAUUwHQYDVR0OBBYEFDPhAYWS0oA+ +# lOtITfjJtyl0knRRMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMF8G +# A1UdHwRYMFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMv +# Y3JsL01pY3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNybDBs +# BggrBgEFBQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cubWljcm9zb2Z0 +# LmNvbS9wa2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUy +# MDIwMTAoMSkuY3J0MAwGA1UdEwEB/wQCMAAwFgYDVR0lAQH/BAwwCgYIKwYBBQUH +# AwgwDgYDVR0PAQH/BAQDAgeAMA0GCSqGSIb3DQEBCwUAA4ICAQCXh+ckCkZaA06S +# NW+qxtS9gHQp4x7G+gdikngKItEr8otkXIrmWPYrarRWBlY91lqGiilHyIlZ3iNB +# UbaNEmaKAGMZ5YcS7IZUKPaq1jU0msyl+8og0t9C/Z26+atx3vshHrFQuSgwTHZV +# pzv7k8CYnBYoxdhI1uGhqH595mqLvtMsxEN/1so7U+b3U6LCry5uwwcz5+j8Oj0G +# UX3b+iZg+As0xTN6T0Qa8BNec/LwcyqYNEaMkW2VAKrmhvWH8OCDTcXgONnnABQH +# BfXK/fLAbHFGS1XNOtr62/iaHBGAkrCGl6Bi8Pfws6fs+w+sE9r3hX9Vg0gsRMoH +# RuMaiXsrGmGsuYnLn3AwTguMatw9R8U5vJtWSlu1CFO5P0LEvQQiMZ12sQSsQAkN +# DTs9rTjVNjjIUgoZ6XPMxlcPIDcjxw8bfeb4y4wAxM2RRoWcxpkx+6IIf2L+b7gL +# HtBxXCWJ5bMW7WwUC2LltburUwBv0SgjpDtbEqw/uDgWBerCT+Zty3Nc967iGaQj +# yYQH6H/h9Xc8smm2n6VjySRx2swnW3hr6Qx63U/xY9HL6FNhrGiFED7ZRKrnwvvX +# vMVQUIEkB7GUEeN6heY8gHLt0jLV3yzDiQA8R8p5YGgGAVt9MEwgAJNY1iHvH/8v +# zhJSZFNkH8svRztO/i3TvKrjb8ZxwjCCB3EwggVZoAMCAQICEzMAAAAVxedrngKb +# SZkAAAAAABUwDQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmlj +# YXRlIEF1dGhvcml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIy +# NVowfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT +# B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UE +# AxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXI +# yjVX9gF/bErg4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjo +# YH1qUoNEt6aORmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1y +# aa8dq6z2Nr41JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v +# 3byNpOORj7I5LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pG +# ve2krnopN6zL64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viS +# kR4dPf0gz3N9QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYr +# bqgSUei/BQOj0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlM +# jgK8QmguEOqEUUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSL +# W6CmgyFdXzB0kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AF +# emzFER1y7435UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIu +# rQIDAQABo4IB3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIE +# FgQUKqdS/mTEmr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWn +# G1M1GelyMFwGA1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEW +# M2h0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5 +# Lmh0bTATBgNVHSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBi +# AEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV +# 9lbLj+iiXGJo0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3Js +# Lm1pY3Jvc29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAx +# MC0wNi0yMy5jcmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8v +# d3d3Lm1pY3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2 +# LTIzLmNydDANBgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv +# 6lwUtj5OR2R4sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZn +# OlNN3Zi6th542DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1 +# bSNU5HhTdSRXud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4 +# rPf5KYnDvBewVIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU +# 6ZGyqVvfSaN0DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDF +# NLB62FD+CljdQDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/ +# HltEAY5aGZFrDZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdU +# CbFpAUR+fKFhbHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKi +# excdFYmNcP7ntdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTm +# dHRbatGePu1+oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZq +# ELQdVTNYs6FwZvKhggNQMIICOAIBATCB+aGB0aSBzjCByzELMAkGA1UEBhMCVVMx +# EzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoT +# FU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJp +# Y2EgT3BlcmF0aW9uczEnMCUGA1UECxMeblNoaWVsZCBUU1MgRVNOOkEwMDAtMDVF +# MC1EOTQ3MSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFtcCBTZXJ2aWNloiMK +# AQEwBwYFKw4DAhoDFQC8t8hT8KKUX91lU5FqRP9Cfu9MiaCBgzCBgKR+MHwxCzAJ +# BgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25k +# MR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jv +# c29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwMA0GCSqGSIb3DQEBCwUAAgUA6LUDNzAi +# GA8yMDIzMDkyMDA1MzU1MVoYDzIwMjMwOTIxMDUzNTUxWjB3MD0GCisGAQQBhFkK +# BAExLzAtMAoCBQDotQM3AgEAMAoCAQACAidSAgH/MAcCAQACAhN/MAoCBQDotlS3 +# AgEAMDYGCisGAQQBhFkKBAIxKDAmMAwGCisGAQQBhFkKAwKgCjAIAgEAAgMHoSCh +# CjAIAgEAAgMBhqAwDQYJKoZIhvcNAQELBQADggEBAGtIWKlQ4xjkBGBgoktG9bqb +# W3uOsn29c3JcnP5Eq5RSCeHwCRLqC6bYPnrI0V6uJZGaSe/UiVRIjbQsr2Md6Liu +# 18E+/l27E3rd5NKZ4JapQ+nadT7roP/Q2NkZ+hK8kYvV+j0C2aCVDxM6KKvyfXN3 +# 9vIyVoMXXa4Htf6H6hiqbvBelUMohEcS20RXmTcQgBz/4JqhqXiIJBid/2SRudEp +# P4FKC/q7NZu0Kt9vaka5bpOjFkH8DSdsTmNhCnMsz3k60iD9L7fzqu6bIkCGeO9K +# urvs0V5kghKnZiJZ37Bwtng7KlequE58NxNKkuZrEiwepGU/NMZpgCsT31R2Qgwx +# ggQNMIIECQIBATCBkzB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3Rv +# bjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0 +# aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAA +# AdB3CKrvoxfG3QABAAAB0DANBglghkgBZQMEAgEFAKCCAUowGgYJKoZIhvcNAQkD +# MQ0GCyqGSIb3DQEJEAEEMC8GCSqGSIb3DQEJBDEiBCA5XwcAA1GbklJPMnjaBqpF +# NIgNrpeBP842Vo44Tv3PxTCB+gYLKoZIhvcNAQkQAi8xgeowgecwgeQwgb0EIAiV +# QAZftNP/Md1E2Yw+fBXa9w6fjmTZ5WAerrTSPwnXMIGYMIGApH4wfDELMAkGA1UE +# BhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAc +# BgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0 +# IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAHQdwiq76MXxt0AAQAAAdAwIgQgqB/y +# toAW0gc8cem4mHJrpEhQ7NI8Dpr/F6zncI8TlJUwDQYJKoZIhvcNAQELBQAEggIA +# q2johekNXCez3sHPgTENMweCsqyCVgtTV3YML+gpr56aV2vz+Iuy6Bt+8tatbyVW +# ANUYA8RkAftW+u/VvBBJUl0Y/83/DHph0XoaHq0MAZ9zbVWUqU5bcocF4IbZnik9 +# rA86SRXqOrPIK/i4J2vY7dWdPdhV6C8E2jBL0Lx/qiunv2BZy4DfptkRznVY5eRG +# jOcAhlr0s20DS1ylsIuGNf1bloA5Cldc+ObtGVglNPXLKD50YKsCIl4zshQEwubA +# 42PPlGpDcH8JfZAH/ckamL/wQhCi4UdZlVR7NVSMJ19oDlV3Y2ybLw7pVs6UJsqi +# DSzEdW+634lbvORxEWsOeok0J1tlgjjUGhPjMdFh/96qcqPnInvHqvYOcmVUFfYL +# HnquWfMQxvcHyLni96fLcsfGDGsUaNNjSx4vmaIYJknwCadjHIJyChjhYNQb00bz +# aHP6UJDZf2ZcRhuaKdMGV3lWH2Wens4zDgoYSW0iES9FkqIHGh3vy2knZ2CDrY7w +# BdB8PrTm9I7XVen1DEeXtoLusGLn08Jf9UnSXoBq6hptFUJi718OsfXPN26u9/3M +# IKxkdPyvj7pir1X9GaZMyz6eCGJGGtoaBPWAYrJHXoPq/zwpRiGcbK+PLkfI8PRb +# G5flQxQzxdP1hSzAqqE+VCto96sLhASeMZ7gpL87UoQ= +# SIG # End signature block diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/InitializeAssemblyResolver.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/InitializeAssemblyResolver.ps1 new file mode 100644 index 000000000000..f03e9ec7eb08 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/InitializeAssemblyResolver.ps1 @@ -0,0 +1,242 @@ +$assemblyRootPath = [System.IO.Path]::Combine($PSScriptRoot, "..", "lib") +Write-Debug "Initializing ConditionalAssemblyContext. PSEdition is [$($PSVersionTable.PSEdition)]. PSVersion is [$($PSVersionTable.PSVersion)]." +$conditionalAssemblyContext = [Microsoft.Azure.PowerShell.AssemblyLoading.ConditionalAssemblyContext]::new($PSVersionTable.PSEdition, $PSVersionTable.PSVersion) +Write-Debug "Initializing ConditionalAssemblyProvider. AssemblyRootPath is [$assemblyRootPath]." +[Microsoft.Azure.PowerShell.AssemblyLoading.ConditionalAssemblyProvider]::Initialize($assemblyRootPath, $conditionalAssemblyContext) + +if ($PSEdition -eq 'Desktop') { + try { + [Microsoft.Azure.Commands.Profile.Utilities.CustomAssemblyResolver]::Initialize() + } + catch { + Write-Warning $_ + } +} +else { + try { + Add-Type -Path ([System.IO.Path]::Combine($PSScriptRoot, "..", "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll")) | Out-Null + Write-Debug "Registering Az shared AssemblyLoadContext." + [Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.AzAssemblyLoadContextInitializer]::RegisterAzSharedAssemblyLoadContext() + Write-Debug "AssemblyLoadContext registered." + } + catch { + Write-Warning $_ + } +} +# SIG # Begin signature block +# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCAe8RL2QVOwrz6 +# penupFKMe0U4FkbIX5RGfbRRPsEAcqCCDXYwggX0MIID3KADAgECAhMzAAADTrU8 +# esGEb+srAAAAAANOMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI5WhcNMjQwMzE0MTg0MzI5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDdCKiNI6IBFWuvJUmf6WdOJqZmIwYs5G7AJD5UbcL6tsC+EBPDbr36pFGo1bsU +# p53nRyFYnncoMg8FK0d8jLlw0lgexDDr7gicf2zOBFWqfv/nSLwzJFNP5W03DF/1 +# 1oZ12rSFqGlm+O46cRjTDFBpMRCZZGddZlRBjivby0eI1VgTD1TvAdfBYQe82fhm +# WQkYR/lWmAK+vW/1+bO7jHaxXTNCxLIBW07F8PBjUcwFxxyfbe2mHB4h1L4U0Ofa +# +HX/aREQ7SqYZz59sXM2ySOfvYyIjnqSO80NGBaz5DvzIG88J0+BNhOu2jl6Dfcq +# jYQs1H/PMSQIK6E7lXDXSpXzAgMBAAGjggFzMIIBbzAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUnMc7Zn/ukKBsBiWkwdNfsN5pdwAw +# RQYDVR0RBD4wPKQ6MDgxHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEW +# MBQGA1UEBRMNMjMwMDEyKzUwMDUxNjAfBgNVHSMEGDAWgBRIbmTlUAXTgqoXNzci +# tW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIwMTEtMDctMDguY3JsMGEG +# CCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDovL3d3dy5taWNyb3NvZnQu +# Y29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDExXzIwMTEtMDctMDguY3J0 +# MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIBAD21v9pHoLdBSNlFAjmk +# mx4XxOZAPsVxxXbDyQv1+kGDe9XpgBnT1lXnx7JDpFMKBwAyIwdInmvhK9pGBa31 +# TyeL3p7R2s0L8SABPPRJHAEk4NHpBXxHjm4TKjezAbSqqbgsy10Y7KApy+9UrKa2 +# kGmsuASsk95PVm5vem7OmTs42vm0BJUU+JPQLg8Y/sdj3TtSfLYYZAaJwTAIgi7d +# hzn5hatLo7Dhz+4T+MrFd+6LUa2U3zr97QwzDthx+RP9/RZnur4inzSQsG5DCVIM +# pA1l2NWEA3KAca0tI2l6hQNYsaKL1kefdfHCrPxEry8onJjyGGv9YKoLv6AOO7Oh +# JEmbQlz/xksYG2N/JSOJ+QqYpGTEuYFYVWain7He6jgb41JbpOGKDdE/b+V2q/gX +# UgFe2gdwTpCDsvh8SMRoq1/BNXcr7iTAU38Vgr83iVtPYmFhZOVM0ULp/kKTVoir +# IpP2KCxT4OekOctt8grYnhJ16QMjmMv5o53hjNFXOxigkQWYzUO+6w50g0FAeFa8 +# 5ugCCB6lXEk21FFB1FdIHpjSQf+LP/W2OV/HfhC3uTPgKbRtXo83TZYEudooyZ/A +# Vu08sibZ3MkGOJORLERNwKm2G7oqdOv4Qj8Z0JrGgMzj46NFKAxkLSpE5oHQYP1H +# tPx1lPfD7iNSbJsP6LiUHXH1MIIHejCCBWKgAwIBAgIKYQ6Q0gAAAAAAAzANBgkq +# hkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x +# EDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv +# bjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 +# IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEwOTA5WjB+MQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYDVQQDEx9NaWNyb3NvZnQg +# Q29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +# CgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+laUKq4BjgaBEm6f8MMHt03 +# a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc6Whe0t+bU7IKLMOv2akr +# rnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4Ddato88tt8zpcoRb0Rrrg +# OGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+lD3v++MrWhAfTVYoonpy +# 4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nkkDstrjNYxbc+/jLTswM9 +# sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6A4aN91/w0FK/jJSHvMAh +# dCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmdX4jiJV3TIUs+UsS1Vz8k +# A/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL5zmhD+kjSbwYuER8ReTB +# w3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zdsGbiwZeBe+3W7UvnSSmn +# Eyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3T8HhhUSJxAlMxdSlQy90 +# lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS4NaIjAsCAwEAAaOCAe0w +# ggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRIbmTlUAXTgqoXNzcitW2o +# ynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNVHQ8EBAMCAYYwDwYD +# VR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBDuRQFTuHqp8cx0SOJNDBa +# BgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpL2Ny +# bC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3JsMF4GCCsG +# AQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3J0MIGfBgNV +# HSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEFBQcCARYzaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1hcnljcHMuaHRtMEAGCCsG +# AQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkAYwB5AF8AcwB0AGEAdABl +# AG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn8oalmOBUeRou09h0ZyKb +# C5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7v0epo/Np22O/IjWll11l +# hJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0bpdS1HXeUOeLpZMlEPXh6 +# I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/KmtYSWMfCWluWpiW5IP0 +# wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvyCInWH8MyGOLwxS3OW560 +# STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBpmLJZiWhub6e3dMNABQam +# ASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJihsMdYzaXht/a8/jyFqGa +# J+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYbBL7fQccOKO7eZS/sl/ah +# XJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbSoqKfenoi+kiVH6v7RyOA +# 9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sLgOppO6/8MO0ETI7f33Vt +# Y5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtXcVZOSEXAQsmbdlsKgEhr +# /Xmfwb1tbWrJUnMTDXpQzTGCGgowghoGAgEBMIGVMH4xCzAJBgNVBAYTAlVTMRMw +# EQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVN +# aWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNp +# Z25pbmcgUENBIDIwMTECEzMAAANOtTx6wYRv6ysAAAAAA04wDQYJYIZIAWUDBAIB +# BQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQwHAYKKwYBBAGCNwIBCzEO +# MAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIMHofDlPBqmVqK1okjwWVgBB +# tT7fuKbvz/K2Z2tehrjfMEIGCisGAQQBgjcCAQwxNDAyoBSAEgBNAGkAYwByAG8A +# cwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20wDQYJKoZIhvcNAQEB +# BQAEggEAh6WOd8mYDPLLkfaNOj1I07laB0TnfUoY3kPU8nRKXndoULPuXHTw+0TR +# ZwgvCjxyErXrV6Gpd03Xy2YcKFMOT5DHY8iV0olxkvZNHTt0oMmIUjYyCkblV3PA +# nrDZGbmmxw3FKRT/n2bQ9SNj7PNl29HgNxQxlDSEl6yJP+Bs11pyfW5uNYNVFPIj +# M5ddEr31Z9y/SwJ0oB892Anu6ZT2Cqy6Xt5XIacqNVpWG00UUVguvrHdelkLF4g4 +# dgI+UROhJfNfXgkmazGilBrufCC3LFe46BZgY3kJavyni3F3qsAujcb8+0QXczTu +# 9omGeP+6mHTHBR+9gPJW9pp+0x6O96GCF5QwgheQBgorBgEEAYI3AwMBMYIXgDCC +# F3wGCSqGSIb3DQEHAqCCF20wghdpAgEDMQ8wDQYJYIZIAWUDBAIBBQAwggFSBgsq +# hkiG9w0BCRABBKCCAUEEggE9MIIBOQIBAQYKKwYBBAGEWQoDATAxMA0GCWCGSAFl +# AwQCAQUABCDB/5pgJMSywQWzPV9JmKhJL6MoNIaXQMIgMZkbopcpUAIGZQQDsMbk +# GBMyMDIzMDkyMDA1NTA0NC4xNTJaMASAAgH0oIHRpIHOMIHLMQswCQYDVQQGEwJV +# UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UE +# ChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQLExxNaWNyb3NvZnQgQW1l +# cmljYSBPcGVyYXRpb25zMScwJQYDVQQLEx5uU2hpZWxkIFRTUyBFU046REMwMC0w +# NUUwLUQ5NDcxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2Wg +# ghHqMIIHIDCCBQigAwIBAgITMwAAAdIhJDFKWL8tEQABAAAB0jANBgkqhkiG9w0B +# AQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD +# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDAeFw0yMzA1MjUxOTEy +# MjFaFw0yNDAyMDExOTEyMjFaMIHLMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2Fz +# aGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENv +# cnBvcmF0aW9uMSUwIwYDVQQLExxNaWNyb3NvZnQgQW1lcmljYSBPcGVyYXRpb25z +# MScwJQYDVQQLEx5uU2hpZWxkIFRTUyBFU046REMwMC0wNUUwLUQ5NDcxJTAjBgNV +# BAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2UwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQDcYIhC0QI/SPaT5+nYSBsSdhBPO2SXM40Vyyg8Fq1T +# PrMNDzxChxWUD7fbKwYGSsONgtjjVed5HSh5il75jNacb6TrZwuX+Q2++f2/8CCy +# u8TY0rxEInD3Tj52bWz5QRWVQejfdCA/n6ZzinhcZZ7+VelWgTfYC7rDrhX3TBX8 +# 9elqXmISOVIWeXiRK8h9hH6SXgjhQGGQbf2bSM7uGkKzJ/pZ2LvlTzq+mOW9iP2j +# cYEA4bpPeurpglLVUSnGGQLmjQp7Sdy1wE52WjPKdLnBF6JbmSREM/Dj9Z7okxRN +# UjYSdgyvZ1LWSilhV/wegYXVQ6P9MKjRnE8CI5KMHmq7EsHhIBK0B99dFQydL1vd +# uC7eWEjzz55Z/DyH6Hl2SPOf5KZ4lHf6MUwtgaf+MeZxkW0ixh/vL1mX8VsJTHa8 +# AH+0l/9dnWzFMFFJFG7g95nHJ6MmYPrfmoeKORoyEQRsSus2qCrpMjg/P3Z9WJAt +# FGoXYMD19NrzG4UFPpVbl3N1XvG4/uldo1+anBpDYhxQU7k1gfHn6QxdUU0TsrJ/ +# JCvLffS89b4VXlIaxnVF6QZh+J7xLUNGtEmj6dwPzoCfL7zqDZJvmsvYNk1lcbyV +# xMIgDFPoA2fZPXHF7dxahM2ZG7AAt3vZEiMtC6E/ciLRcIwzlJrBiHEenIPvxW15 +# qwIDAQABo4IBSTCCAUUwHQYDVR0OBBYEFCC2n7cnR3ToP/kbEZ2XJFFmZ1kkMB8G +# A1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMF8GA1UdHwRYMFYwVKBSoFCG +# Tmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY3Jvc29mdCUy +# MFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNybDBsBggrBgEFBQcBAQRgMF4w +# XAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvY2Vy +# dHMvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAoMSkuY3J0MAwG +# A1UdEwEB/wQCMAAwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwgwDgYDVR0PAQH/BAQD +# AgeAMA0GCSqGSIb3DQEBCwUAA4ICAQCw5iq0Ey0LlAdz2PcqchRwW5d+fitNISCv +# qD0E6W/AyiTk+TM3WhYTaxQ2pP6Or4qOV+Du7/L+k18gYr1phshxVMVnXNcdjecM +# tTWUOVAwbJoeWHaAgknNIMzXK3+zguG5TVcLEh/CVMy1J7KPE8Q0Cz56NgWzd9ur +# G+shSDKkKdhOYPXF970Mr1GCFFpe1oXjEy6aS+Heavp2wmy65mbu0AcUOPEn+hYq +# ijgLXSPqvuFmOOo5UnSV66Dv5FdkqK7q5DReox9RPEZcHUa+2BUKPjp+dQ3D4c9I +# H8727KjMD8OXZomD9A8Mr/fcDn5FI7lfZc8ghYc7spYKTO/0Z9YRRamhVWxxrIsB +# N5LrWh+18soXJ++EeSjzSYdgGWYPg16hL/7Aydx4Kz/WBTUmbGiiVUcE/I0aQU2U +# /0NzUiIFIW80SvxeDWn6I+hyVg/sdFSALP5JT7wAe8zTvsrI2hMpEVLdStFAMqan +# FYqtwZU5FoAsoPZ7h1ElWmKLZkXk8ePuALztNY1yseO0TwdueIGcIwItrlBYg1Xp +# Pz1+pMhGMVble6KHunaKo5K/ldOM0mQQT4Vjg6ZbzRIVRoDcArQ5//0875jOUvJt +# Yyc7Hl04jcmvjEIXC3HjkUYvgHEWL0QF/4f7vLAchaEZ839/3GYOdqH5VVnZrUIB +# QB6DTaUILDCCB3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUwDQYJKoZI +# hvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAw +# DgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24x +# MjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAy +# MDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkGA1UEBhMC +# VVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNV +# BAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRp +# bWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +# AQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXIyjVX9gF/bErg4r25Phdg +# M/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNEt6aORmsHFPPF +# dvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1yaa8dq6z2Nr41JmTamDu6 +# GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5LFGc6XBp +# Dco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pGve2krnopN6zL64NF50Zu +# yjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9QZpGdc3E +# XzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYrbqgSUei/BQOj0XOmTTd0 +# lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqEUUbi0b1q +# GFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSLW6CmgyFdXzB0kZSU2LlQ +# +QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AFemzFER1y7435UsSFF5PA +# PBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQIDAQABo4IB3TCCAdkw +# EgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQUKqdS/mTEmr6CkTxG +# NSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMFwGA1UdIARV +# MFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93d3cubWlj +# cm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNVHSUEDDAK +# BggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNVHQ8EBAMC +# AYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo0T2UkFvX +# zpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20v +# cGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5jcmwwWgYI +# KwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDANBgkqhkiG +# 9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4sQaTlz0x +# M7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th542DYunKmC +# VgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhTdSRXud2f8449 +# xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4rPf5KYnDvBewVIVCs/wM +# nosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0DLzskYDS +# PeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDFNLB62FD+CljdQDzHVG2d +# Y3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFrDZ+kKNxn +# GSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdUCbFpAUR+fKFhbHP+Crvs +# QWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7ntdAoGokL +# jzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTmdHRbatGePu1+oDEzfbzL +# 6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZqELQdVTNYs6FwZvKhggNN +# MIICNQIBATCB+aGB0aSBzjCByzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hp +# bmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jw +# b3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJpY2EgT3BlcmF0aW9uczEn +# MCUGA1UECxMeblNoaWVsZCBUU1MgRVNOOkRDMDAtMDVFMC1EOTQ3MSUwIwYDVQQD +# ExxNaWNyb3NvZnQgVGltZS1TdGFtcCBTZXJ2aWNloiMKAQEwBwYFKw4DAhoDFQCJ +# ptLCZsE06NtmHQzB5F1TroFSBqCBgzCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwMA0GCSqGSIb3DQEBCwUAAgUA6LRwyDAiGA8yMDIzMDkxOTE5MTEw +# NFoYDzIwMjMwOTIwMTkxMTA0WjB0MDoGCisGAQQBhFkKBAExLDAqMAoCBQDotHDI +# AgEAMAcCAQACAi5fMAcCAQACAhMzMAoCBQDotcJIAgEAMDYGCisGAQQBhFkKBAIx +# KDAmMAwGCisGAQQBhFkKAwKgCjAIAgEAAgMHoSChCjAIAgEAAgMBhqAwDQYJKoZI +# hvcNAQELBQADggEBABSMhArCfMaUns9Ybi+bd7CrSqySoFW9FQHNYSc/7Z4kVIDH +# MOSWB04XzoJV+b5q9p40kFfOlc5b184s/ZuR0zXF8NOTag0yTpWUYZDo3OrdVa45 +# g1JiqIjXs1Mpilyf/r194uoB8G63Kyxv4tyQX01/UL1ohtT88bXEDl6pNb+Xyhu/ +# 3benlypP9gr5fXHU1AcSpR/fuLO2QX4Inqqsrn8073fZkUrFfXeHgYGscjH/6A8V +# xK3x86MVX85OKS7L48K64XMJmuNzDOPMz7fbFLtwrj3tXhnU179w/GuGdvFgRaPf +# VfxZcx4y31FR1J4hDsrSVj/eGul6ZvDhEP5llugxggQNMIIECQIBATCBkzB8MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNy +# b3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAdIhJDFKWL8tEQABAAAB0jAN +# BglghkgBZQMEAgEFAKCCAUowGgYJKoZIhvcNAQkDMQ0GCyqGSIb3DQEJEAEEMC8G +# CSqGSIb3DQEJBDEiBCDABiZtIILyalxFaNkpSNLPyB6dnqa8Og8PeO2M5QwQvjCB +# +gYLKoZIhvcNAQkQAi8xgeowgecwgeQwgb0EIMeAIJPf30i9ZbOExU557GwWNaLH +# 0Z5s65JFga2DeaROMIGYMIGApH4wfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldh +# c2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBD +# b3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIw +# MTACEzMAAAHSISQxSli/LREAAQAAAdIwIgQgxHcZpEl6iRNRIzFH1U59AFtiyMD5 +# cXN76GiPGy+kKMAwDQYJKoZIhvcNAQELBQAEggIA0Ev33yJgxJMIh75Ft6iuoxJH +# qmm0N6lliYKEIWF42TZBKU4ubpdr1tca9Wt8bL/AagZ4tEEb1fKBJTwmedSQQOey +# cWdkjeXRlHqBkHEpz/u+yIl9/4KojgmxT9P0ZNfHPjQxt9Zb7wubc2N9tgJ6ZwXr +# Kx/1DZkiKwXXRbNga7yyVM924J0/xokBiDkWtWKF4UOdEAtAoQmxwtVFWnJBVVQK +# BV8bAgi4+5lGrD1PoX1/uLd1hsnr0+/qu/Lz8f20DcFmPrp+gEXLdDCvws93b9fx +# 3hSuuVawfT8XFnXEut989RtYBlYkOPgDIrUbuHj5EqmB19UnhOeFkvhMHEqq+XKo +# kO9mHo8WZOnMFYM8FeSclxl3z/3jrAEibfoXBpVXFv1F3GGt5WH+2UWs7JXTK01R +# tnDr6DRsMEIr0yw2g1cb//u0BkmcEwBXr51dNX3E0WAxqVJk9yjV+YuGLjeD569E +# wDGANqkm83LIALMCBaBAzjVoG8jVnR0gLXrca7i+ez1h/jVDl5GmGcVfdgvxzDYk +# +uMpr/FsnoEFMGiBe/9l72gXY7pnoCipoNTx6q3GA3cfzfVDw27c8AzCny1DHUvj +# cUPCdId96d7eIR//lZo+DnJdQ+rsPlDuqpPdoldS/TzlCl+5Z8idTtxp9kSqzt8O +# aZYYi6hivyQoGN3avBU= +# SIG # End signature block diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/[Content_Types].xml b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/[Content_Types].xml new file mode 100644 index 000000000000..247435745a35 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/[Content_Types].xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/_rels/.rels b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/_rels/.rels new file mode 100644 index 000000000000..756a7cb14f58 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/_rels/.rels @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/en-US/about_az.help.txt b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/en-US/about_az.help.txt new file mode 100644 index 000000000000..fb4a5e9becd1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/en-US/about_az.help.txt @@ -0,0 +1,50 @@ +About topic for Azure PowerShell - about_az + +TOPIC + +about_Az + +SHORT DESCRIPTION + +The Azure Az PowerShell module is a set of cmdlets for managing Azure +resources directly from the PowerShell command line and in PowerShell +scripts. + +LONG DESCRIPTION + +Azure PowerShell provides cross-platform cmdlets for managing Azure +services. All Azure PowerShell cmdlets work on Windows PowerShell 5.1 and +supported versions of PowerShell 7. + +The Azure PowerShell cmdlets follow the naming convention {verb}-Az{noun}. + +- {verb} is an approved PowerShell verb reflecting the corresponding HTTP + operation. + +- {noun} matches or has a close equivalent to the name of the resource. + +The cmdlets produce .NET objects that can be piped between commands +simplifying the sequencing of commands making Azure PowerShell a powerful +solution for scripting and automation purposes. + +A PowerShell module is available for each Azure service. For convenience, +we provide a wrapper module named "Az" that comprises the stable modules. +Modules in preview must be installed independently or via the "AzPreview" +wrapper module. + +Azure PowerShell is frequently updated to include bug fixes and service +updates. It is recommended to plan to update to the most recent version +regularly (a minimum of twice a year). + +GETTING STARTED + +1. Connect to Azure using Connect-AzAccount + +2. Run your first command. For example, create a resource group in the + east US region. + + New-AzResourceGroup -Name "MyResoureGroup" -location "eastus" + +SEE ALSO + +Azure PowerShell documentation: https://learn.microsoft.com/powershell/azure diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Azure.Core.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Azure.Core.dll new file mode 100644 index 000000000000..66f3d3165b86 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Azure.Core.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Microsoft.Identity.Client.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..7e98f30fc54a Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp3.1/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp3.1/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..02168e3b1856 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp3.1/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Azure.Core.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Azure.Core.dll new file mode 100644 index 000000000000..2593da6045ce Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Azure.Core.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..87f0bdfe02f2 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..2a1b17bc86a4 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Newtonsoft.Json.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Newtonsoft.Json.dll new file mode 100644 index 000000000000..9f13f1f8a4fd Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Newtonsoft.Json.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Diagnostics.DiagnosticSource.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Diagnostics.DiagnosticSource.dll new file mode 100644 index 000000000000..92419a27e0c2 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Diagnostics.DiagnosticSource.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Numerics.Vectors.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Numerics.Vectors.dll new file mode 100644 index 000000000000..08659724d4f8 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Numerics.Vectors.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Reflection.DispatchProxy.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Reflection.DispatchProxy.dll new file mode 100644 index 000000000000..674ced0460de Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Reflection.DispatchProxy.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Runtime.CompilerServices.Unsafe.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 000000000000..c5ba4e4047a1 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Security.Cryptography.Cng.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Security.Cryptography.Cng.dll new file mode 100644 index 000000000000..4f4c30e080bd Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Security.Cryptography.Cng.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Text.Encodings.Web.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Text.Encodings.Web.dll new file mode 100644 index 000000000000..6d2b207854ac Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Text.Encodings.Web.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Xml.ReaderWriter.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Xml.ReaderWriter.dll new file mode 100644 index 000000000000..022e63a21a86 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Xml.ReaderWriter.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.BrokeredAuthentication.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.BrokeredAuthentication.dll new file mode 100644 index 000000000000..4b4b2f2b663d Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.BrokeredAuthentication.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.dll new file mode 100644 index 000000000000..5662a76ad958 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll new file mode 100644 index 000000000000..f2955edfecb7 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.Broker.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.Broker.dll new file mode 100644 index 000000000000..3e0a147d4bcb Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.Broker.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.NativeInterop.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.NativeInterop.dll new file mode 100644 index 000000000000..a7d555909366 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.NativeInterop.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll new file mode 100644 index 000000000000..f793fd89bece Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Buffers.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Buffers.dll new file mode 100644 index 000000000000..c517a3b62cc7 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Buffers.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.Data.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.Data.dll new file mode 100644 index 000000000000..6f2a3e0ad07f Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.Data.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.dll new file mode 100644 index 000000000000..bdfc501e9647 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Net.Http.WinHttpHandler.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Net.Http.WinHttpHandler.dll new file mode 100644 index 000000000000..8bd471e74c6e Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Net.Http.WinHttpHandler.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Private.ServiceModel.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Private.ServiceModel.dll new file mode 100644 index 000000000000..3f9f84edf0ed Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Private.ServiceModel.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.AccessControl.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.AccessControl.dll new file mode 100644 index 000000000000..36fb33af4590 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.AccessControl.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Permissions.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Permissions.dll new file mode 100644 index 000000000000..2a353ee22eec Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Permissions.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Principal.Windows.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Principal.Windows.dll new file mode 100644 index 000000000000..19d0fc0e971c Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Principal.Windows.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.ServiceModel.Primitives.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.ServiceModel.Primitives.dll new file mode 100644 index 000000000000..c1aa0a64f8f9 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.ServiceModel.Primitives.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Text.Json.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Text.Json.dll new file mode 100644 index 000000000000..fe2154a3bf3a Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Text.Json.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Threading.Tasks.Extensions.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Threading.Tasks.Extensions.dll new file mode 100644 index 000000000000..dfab23478ab4 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Threading.Tasks.Extensions.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime.dll new file mode 100644 index 000000000000..70162a8713a2 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_arm64.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_arm64.dll new file mode 100644 index 000000000000..aca4cb32691f Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_arm64.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_x86.dll b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_x86.dll new file mode 100644 index 000000000000..24735b8531b8 Binary files /dev/null and b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_x86.dll differ diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/package/services/metadata/core-properties/f9ac9c2e40914e78a646a7b0b997403b.psmdcp b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/package/services/metadata/core-properties/f9ac9c2e40914e78a646a7b0b997403b.psmdcp new file mode 100644 index 000000000000..d07e7bb54153 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/modules/Az.Accounts/2.13.1/package/services/metadata/core-properties/f9ac9c2e40914e78a646a7b0b997403b.psmdcp @@ -0,0 +1,11 @@ + + + Microsoft Corporation + Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://learn.microsoft.com/powershell/azure/authenticate-azureps + Az.Accounts + 2.13.1 + Azure ResourceManager ARM Accounts Authentication Environment Subscription PSModule PSIncludes_Cmdlet PSCmdlet_Disable-AzDataCollection PSCmdlet_Disable-AzContextAutosave PSCmdlet_Enable-AzDataCollection PSCmdlet_Enable-AzContextAutosave PSCmdlet_Remove-AzEnvironment PSCmdlet_Get-AzEnvironment PSCmdlet_Set-AzEnvironment PSCmdlet_Add-AzEnvironment PSCmdlet_Get-AzSubscription PSCmdlet_Connect-AzAccount PSCmdlet_Get-AzContext PSCmdlet_Set-AzContext PSCmdlet_Import-AzContext PSCmdlet_Save-AzContext PSCmdlet_Get-AzTenant PSCmdlet_Send-Feedback PSCmdlet_Resolve-AzError PSCmdlet_Select-AzContext PSCmdlet_Rename-AzContext PSCmdlet_Remove-AzContext PSCmdlet_Clear-AzContext PSCmdlet_Disconnect-AzAccount PSCmdlet_Get-AzContextAutosaveSetting PSCmdlet_Set-AzDefault PSCmdlet_Get-AzDefault PSCmdlet_Clear-AzDefault PSCmdlet_Register-AzModule PSCmdlet_Enable-AzureRmAlias PSCmdlet_Disable-AzureRmAlias PSCmdlet_Uninstall-AzureRm PSCmdlet_Invoke-AzRestMethod PSCmdlet_Get-AzAccessToken PSCmdlet_Open-AzSurveyLink PSCmdlet_Get-AzConfig PSCmdlet_Update-AzConfig PSCmdlet_Clear-AzConfig PSCmdlet_Export-AzConfig PSCmdlet_Import-AzConfig PSCommand_Disable-AzDataCollection PSCommand_Disable-AzContextAutosave PSCommand_Enable-AzDataCollection PSCommand_Enable-AzContextAutosave PSCommand_Remove-AzEnvironment PSCommand_Get-AzEnvironment PSCommand_Set-AzEnvironment PSCommand_Add-AzEnvironment PSCommand_Get-AzSubscription PSCommand_Connect-AzAccount PSCommand_Get-AzContext PSCommand_Set-AzContext PSCommand_Import-AzContext PSCommand_Save-AzContext PSCommand_Get-AzTenant PSCommand_Send-Feedback PSCommand_Resolve-AzError PSCommand_Select-AzContext PSCommand_Rename-AzContext PSCommand_Remove-AzContext PSCommand_Clear-AzContext PSCommand_Disconnect-AzAccount PSCommand_Get-AzContextAutosaveSetting PSCommand_Set-AzDefault PSCommand_Get-AzDefault PSCommand_Clear-AzDefault PSCommand_Register-AzModule PSCommand_Enable-AzureRmAlias PSCommand_Disable-AzureRmAlias PSCommand_Uninstall-AzureRm PSCommand_Invoke-AzRestMethod PSCommand_Get-AzAccessToken PSCommand_Open-AzSurveyLink PSCommand_Get-AzConfig PSCommand_Update-AzConfig PSCommand_Clear-AzConfig PSCommand_Export-AzConfig PSCommand_Import-AzConfig PSCommand_Add-AzAccount PSCommand_Login-AzAccount PSCommand_Remove-AzAccount PSCommand_Logout-AzAccount PSCommand_Select-AzSubscription PSCommand_Resolve-Error PSCommand_Save-AzProfile PSCommand_Get-AzDomain PSCommand_Invoke-AzRest PSCommand_Set-AzConfig + NuGet, Version=6.6.1.2, Culture=neutral, PublicKeyToken=31bf3856ad364e35;Microsoft Windows NT 10.0.17763.0;.NET Framework 4.7.2 + \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/AsyncCommandRuntime.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/AsyncCommandRuntime.cs new file mode 100644 index 000000000000..56dcfb51f0db --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/AsyncCommandRuntime.cs @@ -0,0 +1,832 @@ +/*--------------------------------------------------------------------------------------------- + * 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.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + using System.Linq; + + internal interface IAsyncCommandRuntimeExtensions + { + Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep func); + System.Collections.Generic.IEnumerable Wrap(System.Collections.Generic.IEnumerable funcs); + + T ExecuteSync(System.Func step); + } + + public class AsyncCommandRuntime : System.Management.Automation.ICommandRuntime2, IAsyncCommandRuntimeExtensions, System.IDisposable + { + private ICommandRuntime2 originalCommandRuntime; + private System.Threading.Thread originalThread; + public bool AllowInteractive { get; set; } = false; + + public CancellationToken cancellationToken; + SemaphoreSlim semaphore = new SemaphoreSlim(1, 1); + ManualResetEventSlim readyToRun = new ManualResetEventSlim(false); + ManualResetEventSlim completed = new ManualResetEventSlim(false); + + System.Action runOnMainThread; + + private System.Management.Automation.PSCmdlet cmdlet; + + internal AsyncCommandRuntime(System.Management.Automation.PSCmdlet cmdlet, CancellationToken cancellationToken) + { + this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; + this.originalThread = System.Threading.Thread.CurrentThread; + this.cancellationToken = cancellationToken; + this.cmdlet = cmdlet; + if (cmdlet.PagingParameters != null) + { + WriteDebug("Client side pagination is enabled for this cmdlet"); + } + cmdlet.CommandRuntime = this; + } + + public PSHost Host => this.originalCommandRuntime.Host; + + public PSTransactionContext CurrentPSTransaction => this.originalCommandRuntime.CurrentPSTransaction; + + private void CheckForInteractive() + { + // This is an interactive call -- if we are not on the original thread, this will only work if this was done at ACR creation time; + if (!AllowInteractive) + { + throw new System.Exception("AsyncCommandRuntime is not configured for interactive calls"); + } + } + private void WaitOurTurn() + { + // wait for our turn to play + semaphore?.Wait(cancellationToken); + + // ensure that completed is not set + completed.Reset(); + } + + private void WaitForCompletion() + { + // wait for the result (or cancellation!) + WaitHandle.WaitAny(new[] { cancellationToken.WaitHandle, completed?.WaitHandle }); + + // let go of the semaphore + semaphore?.Release(); + + } + + public bool ShouldContinue(string query, string caption, bool hasSecurityImpact, ref bool yesToAll, ref bool noToAll) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption, hasSecurityImpact, ref yesToAll, ref noToAll); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool yta = yesToAll; + bool nta = noToAll; + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption, hasSecurityImpact, ref yta, ref nta); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + yesToAll = yta; + noToAll = nta; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldContinue(string query, string caption) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption, ref yesToAll, ref noToAll); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool yta = yesToAll; + bool nta = noToAll; + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption, ref yta, ref nta); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + yesToAll = yta; + noToAll = nta; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string target) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(target); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(target); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string target, string action) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(target, action); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(target, action); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption, out ShouldProcessReason shouldProcessReason) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption, out shouldProcessReason); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + ShouldProcessReason reason = ShouldProcessReason.None; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption, out reason); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + shouldProcessReason = reason; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void ThrowTerminatingError(ErrorRecord errorRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.ThrowTerminatingError(errorRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.ThrowTerminatingError(errorRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool TransactionAvailable() + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.TransactionAvailable(); + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.TransactionAvailable(); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteCommandDetail(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteCommandDetail(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteCommandDetail(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteDebug(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteDebug(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteDebug(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteError(ErrorRecord errorRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteError(errorRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteError(errorRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteInformation(InformationRecord informationRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteInformation(informationRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteInformation(informationRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteObject(object sendToPipeline) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteObject(sendToPipeline); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteObject(sendToPipeline); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteObject(object sendToPipeline, bool enumerateCollection) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteObject(sendToPipeline, enumerateCollection); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteObject(sendToPipeline, enumerateCollection); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteProgress(ProgressRecord progressRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteProgress(progressRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteProgress(progressRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteProgress(long sourceId, ProgressRecord progressRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteProgress(sourceId, progressRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteProgress(sourceId, progressRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteVerbose(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteVerbose(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteVerbose(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteWarning(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteWarning(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteWarning(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void Wait(System.Threading.Tasks.Task ProcessRecordAsyncTask, System.Threading.CancellationToken cancellationToken) + { + do + { + WaitHandle.WaitAny(new[] { readyToRun.WaitHandle, ((System.IAsyncResult)ProcessRecordAsyncTask).AsyncWaitHandle }); + if (readyToRun.IsSet) + { + // reset the request for the next time + readyToRun.Reset(); + + // run the delegate on this thread + runOnMainThread(); + + // tell the originator everything is complete + completed.Set(); + } + } + while (!ProcessRecordAsyncTask.IsCompleted); + if (ProcessRecordAsyncTask.IsFaulted) + { + // don't unwrap a Aggregate Exception -- we'll lose the stack trace of the actual exception. + // if( ProcessRecordAsyncTask.Exception is System.AggregateException aggregate ) { + // throw aggregate.InnerException; + // } + throw ProcessRecordAsyncTask.Exception; + } + } + public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.SendAsyncStep func) => func.Target.GetType().Name != "Closure" ? func : (p1, p2, p3) => ExecuteSync>(() => func(p1, p2, p3)); + public System.Collections.Generic.IEnumerable Wrap(System.Collections.Generic.IEnumerable funcs) => funcs?.Select(Wrap); + + public T ExecuteSync(System.Func step) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return step(); + } + + T result = default(T); + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + // set the function to run + runOnMainThread = () => { result = step(); }; + // tell the main thread to go ahead + readyToRun.Set(); + // wait for the result (or cancellation!) + WaitForCompletion(); + // return + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void Dispose() + { + if (cmdlet != null) + { + cmdlet.CommandRuntime = this.originalCommandRuntime; + cmdlet = null; + } + + semaphore?.Dispose(); + semaphore = null; + readyToRun?.Dispose(); + readyToRun = null; + completed?.Dispose(); + completed = null; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/AsyncJob.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/AsyncJob.cs new file mode 100644 index 000000000000..73eb84b9b57f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/AsyncJob.cs @@ -0,0 +1,270 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + + using System.Threading.Tasks; + + public class LongRunningJobCancelledException : System.Exception + { + public LongRunningJobCancelledException(string message) : base(message) + { + + } + } + + public class AsyncJob : Job, System.Management.Automation.ICommandRuntime2 + { + const int MaxRecords = 1000; + + private string _statusMessage = string.Empty; + + public override string StatusMessage => _statusMessage; + + public override bool HasMoreData => Output.Count > 0 || Progress.Count > 0 || Error.Count > 0 || Warning.Count > 0 || Verbose.Count > 0 || Debug.Count > 0; + + public override string Location => "localhost"; + + public PSHost Host => originalCommandRuntime.Host; + + public PSTransactionContext CurrentPSTransaction => originalCommandRuntime.CurrentPSTransaction; + + public override void StopJob() + { + Cancel(); + } + + private readonly PSCmdlet cmdlet; + private readonly ICommandRuntime2 originalCommandRuntime; + private readonly System.Threading.Thread originalThread; + + private void CheckForInteractive() + { + // This is an interactive call -- We should never allow interactivity in AsnycJob cmdlets. + throw new System.Exception("Cmdlets in AsyncJob; interactive calls are not permitted."); + } + private bool IsJobDone => CancellationToken.IsCancellationRequested || this.JobStateInfo.State == JobState.Failed || this.JobStateInfo.State == JobState.Stopped || this.JobStateInfo.State == JobState.Stopping || this.JobStateInfo.State == JobState.Completed; + + private readonly System.Action Cancel; + private readonly CancellationToken CancellationToken; + + internal AsyncJob(PSCmdlet cmdlet, string line, string name, CancellationToken cancellationToken, System.Action cancelMethod) : base(line, name) + { + SetJobState(JobState.NotStarted); + // know how to cancel/check for cancelation + this.CancellationToken = cancellationToken; + this.Cancel = cancelMethod; + + // we might need these. + this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; + this.originalThread = System.Threading.Thread.CurrentThread; + + // the instance of the cmdlet we're going to run + this.cmdlet = cmdlet; + + // set the command runtime to the AsyncJob + cmdlet.CommandRuntime = this; + } + + /// + /// Monitors the task (which should be ProcessRecordAsync) to control + /// the lifetime of the job itself + /// + /// + public void Monitor(Task task) + { + SetJobState(JobState.Running); + task.ContinueWith(antecedent => + { + if (antecedent.IsCanceled) + { + // if the task was canceled, we're just going to call it completed. + SetJobState(JobState.Completed); + } + else if (antecedent.IsFaulted) + { + foreach (var innerException in antecedent.Exception.Flatten().InnerExceptions) + { + WriteError(new System.Management.Automation.ErrorRecord(innerException, string.Empty, System.Management.Automation.ErrorCategory.NotSpecified, null)); + } + + // a fault indicates an actual failure + SetJobState(JobState.Failed); + } + else + { + // otherwiser it's a completed state. + SetJobState(JobState.Completed); + } + }, CancellationToken); + } + + private void CheckForCancellation() + { + if (IsJobDone) + { + throw new LongRunningJobCancelledException("Long running job is canceled or stopping, continuation of the cmdlet is not permitted."); + } + } + + public void WriteInformation(InformationRecord informationRecord) + { + CheckForCancellation(); + + this.Information.Add(informationRecord); + } + + public bool ShouldContinue(string query, string caption, bool hasSecurityImpact, ref bool yesToAll, ref bool noToAll) + { + CheckForInteractive(); + return false; + } + + public void WriteDebug(string text) + { + _statusMessage = text; + CheckForCancellation(); + + if (Debug.IsOpen && Debug.Count < MaxRecords) + { + Debug.Add(new DebugRecord(text)); + } + } + + public void WriteError(ErrorRecord errorRecord) + { + if (Error.IsOpen) + { + Error.Add(errorRecord); + } + } + + public void WriteObject(object sendToPipeline) + { + CheckForCancellation(); + + if (Output.IsOpen) + { + Output.Add(new PSObject(sendToPipeline)); + } + } + + public void WriteObject(object sendToPipeline, bool enumerateCollection) + { + CheckForCancellation(); + + if (enumerateCollection && sendToPipeline is System.Collections.IEnumerable enumerable) + { + foreach (var item in enumerable) + { + WriteObject(item); + } + } + else + { + WriteObject(sendToPipeline); + } + } + + public void WriteProgress(ProgressRecord progressRecord) + { + CheckForCancellation(); + + if (Progress.IsOpen && Progress.Count < MaxRecords) + { + Progress.Add(progressRecord); + } + } + + public void WriteProgress(long sourceId, ProgressRecord progressRecord) + { + CheckForCancellation(); + + if (Progress.IsOpen && Progress.Count < MaxRecords) + { + Progress.Add(progressRecord); + } + } + + public void WriteVerbose(string text) + { + CheckForCancellation(); + + if (Verbose.IsOpen && Verbose.Count < MaxRecords) + { + Verbose.Add(new VerboseRecord(text)); + } + } + + public void WriteWarning(string text) + { + CheckForCancellation(); + + if (Warning.IsOpen && Warning.Count < MaxRecords) + { + Warning.Add(new WarningRecord(text)); + } + } + + public void WriteCommandDetail(string text) + { + WriteVerbose(text); + } + + public bool ShouldProcess(string target) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string target, string action) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption, out ShouldProcessReason shouldProcessReason) + { + CheckForInteractive(); + shouldProcessReason = ShouldProcessReason.None; + return false; + } + + public bool ShouldContinue(string query, string caption) + { + CheckForInteractive(); + return false; + } + + public bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll) + { + CheckForInteractive(); + return false; + } + + public bool TransactionAvailable() + { + // interactivity required? + return false; + } + + public void ThrowTerminatingError(ErrorRecord errorRecord) + { + if (Error.IsOpen) + { + Error.Add(errorRecord); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/AsyncOperationResponse.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/AsyncOperationResponse.cs new file mode 100644 index 000000000000..293e05aa6bdb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/AsyncOperationResponse.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. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Extensions; + + [System.ComponentModel.TypeConverter(typeof(AsyncOperationResponseTypeConverter))] + public class AsyncOperationResponse + { + private string _target; + public string Target { get => _target; set => _target = value; } + public AsyncOperationResponse() + { + } + internal AsyncOperationResponse(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json) + { + // pull target + { Target = If(json?.PropertyT("target"), out var _v) ? (string)_v : (string)Target; } + } + public string ToJsonString() + { + return $"{{ \"target\" : \"{this.Target}\" }}"; + } + + public static AsyncOperationResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonObject json ? new AsyncOperationResponse(json) : null; + } + + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static AsyncOperationResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(jsonText)); + + } + + public partial class AsyncOperationResponseTypeConverter : System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to a type + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static object ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(AsyncOperationResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AsyncOperationResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString()); ; + } + catch + { + // Unable to use JSON pattern + } + + if (typeof(System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return new AsyncOperationResponse { Target = (sourceValue as System.Management.Automation.PSObject).GetValueForProperty("target", "", global::System.Convert.ToString) }; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return new AsyncOperationResponse { Target = (sourceValue as global::System.Collections.IDictionary).GetValueForProperty("target", "", global::System.Convert.ToString) }; + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs new file mode 100644 index 000000000000..28a517116d86 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "CmdletSurface")] + [DoNotExport] + public class ExportCmdletSurface : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string CmdletFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public bool IncludeGeneralParameters { get; set; } + + [Parameter] + public bool UseExpandedFormat { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = GetScriptCmdlets(this, CmdletFolder) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .ToArray(); + var allProfiles = variants.SelectMany(v => v.Profiles).Distinct().ToArray(); + var profileGroups = allProfiles.Any() + ? variants + .SelectMany(v => (v.Profiles.Any() ? v.Profiles : allProfiles).Select(p => (profile: p, variant: v))) + .GroupBy(pv => pv.profile) + .Select(pvg => new ProfileGroup(pvg.Select(pv => pv.variant).ToArray(), pvg.Key)) + : new[] { new ProfileGroup(variants) }; + foreach (var profileGroup in profileGroups) + { + var variantGroups = profileGroup.Variants + .GroupBy(v => new { v.CmdletName }) + .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), String.Empty, profileGroup.ProfileName)); + var sb = UseExpandedFormat ? ExpandedFormat(variantGroups) : CondensedFormat(variantGroups); + Directory.CreateDirectory(OutputFolder); + File.WriteAllText(Path.Combine(OutputFolder, $"CmdletSurface-{profileGroup.ProfileName}.md"), sb.ToString()); + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private StringBuilder ExpandedFormat(IEnumerable variantGroups) + { + var sb = new StringBuilder(); + foreach (var variantGroup in variantGroups.OrderBy(vg => vg.CmdletName)) + { + sb.Append($"### {variantGroup.CmdletName}{Environment.NewLine}"); + var parameterGroups = variantGroup.ParameterGroups + .Where(pg => !pg.DontShow && (IncludeGeneralParameters || (pg.OrderCategory != ParameterCategory.Azure && pg.OrderCategory != ParameterCategory.Runtime))); + foreach (var parameterGroup in parameterGroups) + { + sb.Append($" - {parameterGroup.ParameterName} `{parameterGroup.ParameterType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + private StringBuilder CondensedFormat(IEnumerable variantGroups) + { + var sb = new StringBuilder(); + var condensedGroups = variantGroups + .GroupBy(vg => vg.CmdletNoun) + .Select(vgg => ( + CmdletNoun: vgg.Key, + CmdletVerbs: vgg.Select(vg => vg.CmdletVerb).OrderBy(cv => cv).ToArray(), + ParameterGroups: vgg.SelectMany(vg => vg.ParameterGroups).DistinctBy(p => p.ParameterName).ToArray(), + OutputTypes: vgg.SelectMany(vg => vg.OutputTypes).Select(ot => ot.Type).DistinctBy(t => t.Name).Select(t => t.ToSyntaxTypeName()).ToArray())) + .OrderBy(vg => vg.CmdletNoun); + foreach (var condensedGroup in condensedGroups) + { + sb.Append($"### {condensedGroup.CmdletNoun} [{String.Join(", ", condensedGroup.CmdletVerbs)}] `{String.Join(", ", condensedGroup.OutputTypes)}`{Environment.NewLine}"); + var parameterGroups = condensedGroup.ParameterGroups + .Where(pg => !pg.DontShow && (IncludeGeneralParameters || (pg.OrderCategory != ParameterCategory.Azure && pg.OrderCategory != ParameterCategory.Runtime))); + foreach (var parameterGroup in parameterGroups) + { + sb.Append($" - {parameterGroup.ParameterName} `{parameterGroup.ParameterType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs new file mode 100644 index 000000000000..f4b3be298c8f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ExampleStub")] + [DoNotExport] + public class ExportExampleStub : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + + var exampleText = String.Join(String.Empty, DefaultExampleHelpInfos.Select(ehi => ehi.ToHelpExampleOutput())); + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var cmdletFilePaths = GetScriptCmdlets(exportDirectory).Select(fi => Path.Combine(outputFolder, $"{fi.Name}.md")).ToArray(); + var currentExamplesFilePaths = Directory.GetFiles(outputFolder).ToArray(); + // Remove examples of non-existing cmdlets + var removedCmdletFilePaths = currentExamplesFilePaths.Except(cmdletFilePaths); + foreach (var removedCmdletFilePath in removedCmdletFilePaths) + { + File.Delete(removedCmdletFilePath); + } + + // Only create example stubs if they don't exist + foreach (var cmdletFilePath in cmdletFilePaths.Except(currentExamplesFilePaths)) + { + File.WriteAllText(cmdletFilePath, exampleText); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs new file mode 100644 index 000000000000..70fab9d48ad7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "FormatPs1xml")] + [DoNotExport] + public class ExportFormatPs1xml : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string FilePath { get; set; } + + private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support"; + private const string PropertiesExcludedForTableview = @""; + + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + + protected override void ProcessRecord() + { + try + { + var viewModels = GetFilteredViewParameters().Select(CreateViewModel).ToList(); + var ps1xml = new Configuration + { + ViewDefinitions = new ViewDefinitions + { + Views = viewModels + } + }; + File.WriteAllText(FilePath, ps1xml.ToXmlString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private static IEnumerable GetFilteredViewParameters() + { + //https://stackoverflow.com/a/79738/294804 + //https://stackoverflow.com/a/949285/294804 + var types = Assembly.GetExecutingAssembly().GetExportedTypes() + .Where(t => t.IsClass + && (t.Namespace.StartsWith(ModelNamespace) || t.Namespace.StartsWith(SupportNamespace)) + && !t.GetCustomAttributes().Any()); + return types.Select(t => new ViewParameters(t, t.GetProperties() + .Select(p => new PropertyFormat(p)) + .Where(pf => !pf.Property.GetCustomAttributes().Any() + && (!PropertiesExcludedForTableview.Split(',').Contains(pf.Property.Name)) + && (pf.FormatTable != null || (pf.Origin != PropertyOrigin.Inlined && pf.Property.PropertyType.IsPsSimple()))) + .OrderByDescending(pf => pf.Index.HasValue) + .ThenBy(pf => pf.Index) + .ThenByDescending(pf => pf.Origin.HasValue) + .ThenBy(pf => pf.Origin))).Where(vp => vp.Properties.Any()); + } + + private static View CreateViewModel(ViewParameters viewParameters) + { + var entries = viewParameters.Properties.Select(pf => + (TableColumnHeader: new TableColumnHeader { Label = pf.Label, Width = pf.Width }, + TableColumnItem: new TableColumnItem { PropertyName = pf.Property.Name })).ToArray(); + + return new View + { + Name = viewParameters.Type.FullName, + ViewSelectedBy = new ViewSelectedBy + { + TypeName = viewParameters.Type.FullName + }, + TableControl = new TableControl + { + TableHeaders = new TableHeaders + { + TableColumnHeaders = entries.Select(e => e.TableColumnHeader).ToList() + }, + TableRowEntries = new TableRowEntries + { + TableRowEntry = new TableRowEntry + { + TableColumnItems = new TableColumnItems + { + TableItems = entries.Select(e => e.TableColumnItem).ToList() + } + } + } + } + }; + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs new file mode 100644 index 000000000000..f2af0f655581 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs @@ -0,0 +1,56 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.MarkdownRenderer; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "HelpMarkdown")] + [DoNotExport] + public class ExportHelpMarkdown : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSModuleInfo ModuleInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSObject[] FunctionInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSObject[] HelpInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string DocsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExamplesFolder { get; set; } + + [Parameter()] + public SwitchParameter AddComplexInterfaceInfo { get; set; } + + protected override void ProcessRecord() + { + try + { + var helpInfos = HelpInfo.Select(hi => hi.ToPsHelpInfo()); + var variantGroups = FunctionInfo.Select(fi => fi.BaseObject).Cast() + .Join(helpInfos, fi => fi.Name, phi => phi.CmdletName, (fi, phi) => fi.ToVariants(phi)) + .Select(va => new VariantGroup(ModuleInfo.Name, va.First().CmdletName, va, String.Empty)); + WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder, AddComplexInterfaceInfo.IsPresent); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs new file mode 100644 index 000000000000..8671899bd5f3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ModelSurface")] + [DoNotExport] + public class ExportModelSurface : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public bool UseExpandedFormat { get; set; } + + private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Support"; + + protected override void ProcessRecord() + { + try + { + var types = Assembly.GetExecutingAssembly().GetExportedTypes() + .Where(t => t.IsClass && (t.Namespace.StartsWith(ModelNamespace) || t.Namespace.StartsWith(SupportNamespace))); + var typeInfos = types.Select(t => new ModelTypeInfo + { + Type = t, + TypeName = t.Name, + Properties = t.GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => !p.GetIndexParameters().Any()).OrderBy(p => p.Name).ToArray(), + NamespaceGroup = t.Namespace.Split('.').LastOrDefault().EmptyIfNull() + }).Where(mti => mti.Properties.Any()); + var sb = UseExpandedFormat ? ExpandedFormat(typeInfos) : CondensedFormat(typeInfos); + Directory.CreateDirectory(OutputFolder); + File.WriteAllText(Path.Combine(OutputFolder, "ModelSurface.md"), sb.ToString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private static StringBuilder ExpandedFormat(IEnumerable typeInfos) + { + var sb = new StringBuilder(); + foreach (var typeInfo in typeInfos.OrderBy(mti => mti.TypeName).ThenBy(mti => mti.NamespaceGroup)) + { + sb.Append($"### {typeInfo.TypeName} [{typeInfo.NamespaceGroup}]{Environment.NewLine}"); + foreach (var property in typeInfo.Properties) + { + sb.Append($" - {property.Name} `{property.PropertyType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + private static StringBuilder CondensedFormat(IEnumerable typeInfos) + { + var sb = new StringBuilder(); + var typeGroups = typeInfos + .GroupBy(mti => mti.TypeName) + .Select(tig => ( + Types: tig.Select(mti => mti.Type).ToArray(), + TypeName: tig.Key, + Properties: tig.SelectMany(mti => mti.Properties).DistinctBy(p => p.Name).OrderBy(p => p.Name).ToArray(), + NamespaceGroups: tig.Select(mti => mti.NamespaceGroup).OrderBy(ng => ng).ToArray() + )) + .OrderBy(tg => tg.TypeName); + foreach (var typeGroup in typeGroups) + { + var aType = typeGroup.Types.Select(GetAssociativeType).FirstOrDefault(t => t != null); + var aText = aType != null ? $@" \<{aType.ToSyntaxTypeName()}\>" : String.Empty; + sb.Append($"### {typeGroup.TypeName}{aText} [{String.Join(", ", typeGroup.NamespaceGroups)}]{Environment.NewLine}"); + foreach (var property in typeGroup.Properties) + { + var propertyAType = GetAssociativeType(property.PropertyType); + var propertyAText = propertyAType != null ? $" <{propertyAType.ToSyntaxTypeName()}>" : String.Empty; + var enumNames = GetEnumFieldNames(property.PropertyType.Unwrap()); + var enumNamesText = enumNames.Any() ? $" **{{{String.Join(", ", enumNames)}}}**" : String.Empty; + sb.Append($" - {property.Name} `{property.PropertyType.ToSyntaxTypeName()}{propertyAText}`{enumNamesText}{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + //https://stackoverflow.com/a/4963190/294804 + private static Type GetAssociativeType(Type type) => + type.GetInterfaces().FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IAssociativeArray<>))?.GetGenericArguments().First(); + + private static string[] GetEnumFieldNames(Type type) => + type.IsValueType && !type.IsPrimitive && type != typeof(decimal) && type != typeof(DateTime) + ? type.GetFields(BindingFlags.Public | BindingFlags.Static).Where(f => f.FieldType == type).Select(p => p.Name).ToArray() + : new string[] { }; + + private class ModelTypeInfo + { + public Type Type { get; set; } + public string TypeName { get; set; } + public PropertyInfo[] Properties { get; set; } + public string NamespaceGroup { get; set; } + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs new file mode 100644 index 000000000000..f151df7bbc4d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.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.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsHelpers; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.MarkdownRenderer; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsProxyTypeExtensions; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ProxyCmdlet", DefaultParameterSetName = "Docs")] + [DoNotExport] + public class ExportProxyCmdlet : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string[] ModulePath { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string InternalFolder { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + [AllowEmptyString] + public string ModuleDescription { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + [ValidateNotNullOrEmpty] + public string DocsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExamplesFolder { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + public Guid ModuleGuid { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "NoDocs")] + public SwitchParameter ExcludeDocs { get; set; } + + [Parameter(ParameterSetName = "Docs")] + public SwitchParameter AddComplexInterfaceInfo { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = GetModuleCmdletsAndHelpInfo(this, ModulePath).SelectMany(ci => ci.ToVariants()).Where(v => !v.IsDoNotExport).ToArray(); + var allProfiles = variants.SelectMany(v => v.Profiles).Distinct().ToArray(); + var profileGroups = allProfiles.Any() + ? variants + .SelectMany(v => (v.Profiles.Any() ? v.Profiles : allProfiles).Select(p => (profile: p, variant: v))) + .GroupBy(pv => pv.profile) + .Select(pvg => new ProfileGroup(pvg.Select(pv => pv.variant).ToArray(), pvg.Key)) + : new[] { new ProfileGroup(variants) }; + var variantGroups = profileGroups.SelectMany(pg => pg.Variants + .GroupBy(v => new { v.CmdletName, v.IsInternal }) + .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), + Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) + .ToArray(); + + var license = new StringBuilder(); + license.Append(@" +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +"); + HashSet LicenseSet = new HashSet(); + foreach (var variantGroup in variantGroups) + { + var parameterGroups = variantGroup.ParameterGroups.ToList(); + var isValidProfile = !String.IsNullOrEmpty(variantGroup.ProfileName) && variantGroup.ProfileName != NoProfiles; + var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, variantGroup.ProfileName) : ExamplesFolder; + var markdownInfo = new MarkdownHelpInfo(variantGroup, examplesFolder); + List examples = new List(); + foreach (var it in markdownInfo.Examples) + { + examples.Add(it); + } + variantGroup.HelpInfo.Examples = examples.ToArray(); + var sb = new StringBuilder(); + sb.Append($"{Environment.NewLine}"); + sb.Append(variantGroup.ToHelpCommentOutput()); + sb.Append($"function {variantGroup.CmdletName} {{{Environment.NewLine}"); + sb.Append(variantGroup.Aliases.ToAliasOutput()); + sb.Append(variantGroup.OutputTypes.ToOutputTypeOutput()); + sb.Append(variantGroup.ToCmdletBindingOutput()); + sb.Append(variantGroup.ProfileName.ToProfileOutput()); + + sb.Append("param("); + sb.Append($"{(parameterGroups.Any() ? Environment.NewLine : String.Empty)}"); + foreach (var parameterGroup in parameterGroups) + { + var parameters = parameterGroup.HasAllVariants ? parameterGroup.Parameters.Take(1) : parameterGroup.Parameters; + parameters = parameters.Where(p => !p.IsHidden()); + if (!parameters.Any()) + { + continue; + } + foreach (var parameter in parameters) + { + sb.Append(parameter.ToParameterOutput(variantGroup.HasMultipleVariants, parameterGroup.HasAllVariants)); + } + sb.Append(parameterGroup.Aliases.ToAliasOutput(true)); + sb.Append(parameterGroup.HasValidateNotNull.ToValidateNotNullOutput()); + sb.Append(parameterGroup.HasAllowEmptyArray.ToAllowEmptyArray()); + sb.Append(parameterGroup.CompleterInfo.ToArgumentCompleterOutput()); + sb.Append(parameterGroup.OrderCategory.ToParameterCategoryOutput()); + sb.Append(parameterGroup.InfoAttribute.ToInfoOutput(parameterGroup.ParameterType)); + sb.Append(parameterGroup.ToDefaultInfoOutput()); + sb.Append(parameterGroup.ParameterType.ToParameterTypeOutput()); + sb.Append(parameterGroup.Description.ToParameterDescriptionOutput()); + sb.Append(parameterGroup.ParameterName.ToParameterNameOutput(parameterGroups.IndexOf(parameterGroup) == parameterGroups.Count - 1)); + } + sb.Append($"){Environment.NewLine}{Environment.NewLine}"); + + sb.Append(variantGroup.ToBeginOutput()); + sb.Append(variantGroup.ToProcessOutput()); + sb.Append(variantGroup.ToEndOutput()); + + sb.Append($"}}{Environment.NewLine}"); + + Directory.CreateDirectory(variantGroup.OutputFolder); + File.WriteAllText(variantGroup.FilePath, license.ToString()); + File.AppendAllText(variantGroup.FilePath, sb.ToString()); + if (!LicenseSet.Contains(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"))) + { + // only add license in the header + File.AppendAllText(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"), license.ToString()); + LicenseSet.Add(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1")); + } + File.AppendAllText(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"), sb.ToString()); + } + + if (!ExcludeDocs) + { + var moduleInfo = new PsModuleHelpInfo(ModuleName, ModuleGuid, ModuleDescription); + foreach (var variantGroupsByProfile in variantGroups.GroupBy(vg => vg.ProfileName)) + { + var profileName = variantGroupsByProfile.Key; + var isValidProfile = !String.IsNullOrEmpty(profileName) && profileName != NoProfiles; + var docsFolder = isValidProfile ? Path.Combine(DocsFolder, profileName) : DocsFolder; + var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, profileName) : ExamplesFolder; + WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder, AddComplexInterfaceInfo.IsPresent); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs new file mode 100644 index 000000000000..f526439c1813 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportPsd1.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Text.RegularExpressions; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "Psd1")] + [DoNotExport] + public class ExportPsd1 : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string CustomFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Psd1Path { get; set; } + + [Parameter(Mandatory = true)] + public Guid ModuleGuid { get; set; } + + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private const string CustomFolderRelative = "./custom"; + private const string Indent = Psd1Indent; + private const string Undefined = "undefined"; + private bool IsUndefined(string value) => string.Equals(Undefined, value, StringComparison.OrdinalIgnoreCase); + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + if (!Directory.Exists(CustomFolder)) + { + throw new ArgumentException($"Custom folder '{CustomFolder}' does not exist"); + } + + string version = Convert.ToString(@"0.1.0"); + // Validate the module version should be semantic version + // Following regex is official from https://semver.org/ + Regex rx = new Regex(@"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", RegexOptions.Compiled); + if (rx.Matches(version).Count != 1) + { + throw new ArgumentException("Module-version is not a valid Semantic Version"); + } + + string previewVersion = null; + if (version.Contains('-')) + { + string[] versions = version.Split("-".ToCharArray(), 2); + version = versions[0]; + previewVersion = versions[1]; + } + + var sb = new StringBuilder(); + sb.AppendLine("@{"); + sb.AppendLine($@"{GuidStart} = '{ModuleGuid}'"); + sb.AppendLine($@"{Indent}RootModule = '{"./Az.RecoveryServicesBackup.psm1"}'"); + sb.AppendLine($@"{Indent}ModuleVersion = '{version}'"); + sb.AppendLine($@"{Indent}CompatiblePSEditions = 'Core', 'Desktop'"); + sb.AppendLine($@"{Indent}Author = '{"Microsoft Corporation"}'"); + sb.AppendLine($@"{Indent}CompanyName = '{"Microsoft Corporation"}'"); + sb.AppendLine($@"{Indent}Copyright = '{"Microsoft Corporation. All rights reserved."}'"); + sb.AppendLine($@"{Indent}Description = '{"Microsoft Azure PowerShell: RecoveryServicesBackup cmdlets"}'"); + sb.AppendLine($@"{Indent}PowerShellVersion = '5.1'"); + sb.AppendLine($@"{Indent}DotNetFrameworkVersion = '4.7.2'"); + + // RequiredModules + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}RequiredModules = @({"undefined"})"); + } + + // RequiredAssemblies + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}RequiredAssemblies = @({"undefined"})"); + } + else + { + sb.AppendLine($@"{Indent}RequiredAssemblies = '{"./bin/Az.RecoveryServicesBackup.private.dll"}'"); + } + + // NestedModules + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}NestedModules = @({"undefined"})"); + } + + // FormatsToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}FormatsToProcess = @({"undefined"})"); + } + else + { + var customFormatPs1xmlFiles = Directory.GetFiles(CustomFolder) + .Where(f => f.EndsWith(".format.ps1xml")) + .Select(f => $"{CustomFolderRelative}/{Path.GetFileName(f)}"); + var formatList = customFormatPs1xmlFiles.Prepend("./Az.RecoveryServicesBackup.format.ps1xml").ToPsList(); + sb.AppendLine($@"{Indent}FormatsToProcess = {formatList}"); + } + + // TypesToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}TypesToProcess = @({"undefined"})"); + } + + // ScriptsToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}ScriptsToProcess = @({"undefined"})"); + } + + var functionInfos = GetScriptCmdlets(ExportsFolder).ToArray(); + // FunctionsToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}FunctionsToExport = @({"undefined"})"); + } + else + { + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); + } + + // AliasesToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}AliasesToExport = @({"undefined"})"); + } + else + { + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } + + // CmdletsToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}CmdletsToExport = @({"undefined"})"); + } + + sb.AppendLine($@"{Indent}PrivateData = @{{"); + sb.AppendLine($@"{Indent}{Indent}PSData = @{{"); + + if (previewVersion != null) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}Prerelease = '{previewVersion}'"); + } + sb.AppendLine($@"{Indent}{Indent}{Indent}Tags = {"Azure ResourceManager ARM PSModule RecoveryServicesBackup".Split(' ').ToPsList().NullIfEmpty() ?? "''"}"); + sb.AppendLine($@"{Indent}{Indent}{Indent}LicenseUri = '{"https://aka.ms/azps-license"}'"); + sb.AppendLine($@"{Indent}{Indent}{Indent}ProjectUri = '{"https://github.com/Azure/azure-powershell"}'"); + sb.AppendLine($@"{Indent}{Indent}{Indent}ReleaseNotes = ''"); + var profilesList = ""; + if (IsAzure && !String.IsNullOrEmpty(profilesList)) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}Profiles = {profilesList}"); + } + + sb.AppendLine($@"{Indent}{Indent}}}"); + sb.AppendLine($@"{Indent}}}"); + sb.AppendLine(@"}"); + + File.WriteAllText(Psd1Path, sb.ToString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs new file mode 100644 index 000000000000..55cd91ba07c5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -0,0 +1,148 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + if ($allChars) { + return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) + } else { + return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) + } +} +$env = @{} +if ($UsePreviousConfigForRecord) { + $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +function cleanupEnv() { + # Clean resources you create for testing +} +"); + File.WriteAllText(utilFile, sc.ToString()); + } + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath)" +); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} +"); + + + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); + + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); + + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs new file mode 100644 index 000000000000..68766eab0aca --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "CommonParameter")] + [OutputType(typeof(Dictionary))] + [DoNotExport] + public class GetCommonParameter : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSCmdlet PSCmdlet { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public Dictionary PSBoundParameter { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = PSCmdlet.MyInvocation.MyCommand.ToVariants(); + var commonParameterNames = variants.ToParameterGroups() + .Where(pg => pg.OrderCategory == ParameterCategory.Azure || pg.OrderCategory == ParameterCategory.Runtime) + .Select(pg => pg.ParameterName); + if (variants.Any(v => v.SupportsShouldProcess)) + { + commonParameterNames = commonParameterNames.Append("Confirm").Append("WhatIf"); + } + if (variants.Any(v => v.SupportsPaging)) + { + commonParameterNames = commonParameterNames.Append("First").Append("Skip").Append("IncludeTotalCount"); + } + + var names = commonParameterNames.ToArray(); + var keys = PSBoundParameter.Keys.Where(k => names.Contains(k)); + WriteObject(keys.ToDictionary(key => key, key => PSBoundParameter[key]), true); + } + catch (System.Exception ee) + { + System.Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs new file mode 100644 index 000000000000..eafa3e01893a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "ModuleGuid")] + [DoNotExport] + public class GetModuleGuid : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Psd1Path { get; set; } + + protected override void ProcessRecord() + { + try + { + WriteObject(ReadGuidFromPsd1(Psd1Path)); + } + catch (System.Exception ee) + { + System.Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs new file mode 100644 index 000000000000..278d0fb024eb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs @@ -0,0 +1,54 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "ScriptCmdlet")] + [OutputType(typeof(string[]))] + [DoNotExport] + public class GetScriptCmdlet : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ScriptFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeDoNotExport { get; set; } + + [Parameter] + public SwitchParameter AsAlias { get; set; } + + [Parameter] + public SwitchParameter AsFunctionInfo { get; set; } + + protected override void ProcessRecord() + { + try + { + var functionInfos = GetScriptCmdlets(this, ScriptFolder) + .Where(fi => IncludeDoNotExport || !fi.ScriptBlock.Attributes.OfType().Any()) + .ToArray(); + if (AsFunctionInfo) + { + WriteObject(functionInfos, true); + return; + } + var aliases = functionInfos.SelectMany(i => i.ScriptBlock.Attributes).ToAliasNames(); + var names = functionInfos.Select(fi => fi.Name).Distinct(); + var output = (AsAlias ? aliases : names).DefaultIfEmpty("''").ToArray(); + WriteObject(output, true); + } + catch (System.Exception ee) + { + System.Console.Error.WriteLine($"{ee.GetType().Name}: {ee.Message}"); + System.Console.Error.WriteLine(ee.StackTrace); + throw ee; + } + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/CollectionExtensions.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/CollectionExtensions.cs new file mode 100644 index 000000000000..e0b388e9d485 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/CollectionExtensions.cs @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + internal static class CollectionExtensions + { + public static T[] NullIfEmpty(this T[] collection) => (collection?.Any() ?? false) ? collection : null; + public static IEnumerable EmptyIfNull(this IEnumerable collection) => collection ?? Enumerable.Empty(); + + // https://stackoverflow.com/a/4158364/294804 + public static IEnumerable DistinctBy(this IEnumerable collection, Func selector) => + collection.GroupBy(selector).Select(group => group.First()); + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/MarkdownRenderer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/MarkdownRenderer.cs new file mode 100644 index 000000000000..af29bd0b5600 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/MarkdownRenderer.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsProxyOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + internal static class MarkdownRenderer + { + public static void WriteMarkdowns(IEnumerable variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder, bool AddComplexInterfaceInfo = true) + { + Directory.CreateDirectory(docsFolder); + var markdownInfos = variantGroups.Where(vg => !vg.IsInternal).Select(vg => new MarkdownHelpInfo(vg, examplesFolder)).OrderBy(mhi => mhi.CmdletName).ToArray(); + + foreach (var markdownInfo in markdownInfos) + { + var sb = new StringBuilder(); + sb.Append(markdownInfo.ToHelpMetadataOutput()); + sb.Append($"# {markdownInfo.CmdletName}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"## SYNOPSIS{Environment.NewLine}{markdownInfo.Synopsis.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## SYNTAX{Environment.NewLine}{Environment.NewLine}"); + var hasMultipleParameterSets = markdownInfo.SyntaxInfos.Length > 1; + foreach (var syntaxInfo in markdownInfo.SyntaxInfos) + { + sb.Append(syntaxInfo.ToHelpSyntaxOutput(hasMultipleParameterSets)); + } + + sb.Append($"## DESCRIPTION{Environment.NewLine}{markdownInfo.Description.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## EXAMPLES{Environment.NewLine}{Environment.NewLine}"); + foreach (var exampleInfo in markdownInfo.Examples) + { + sb.Append(exampleInfo.ToHelpExampleOutput()); + } + + sb.Append($"## PARAMETERS{Environment.NewLine}{Environment.NewLine}"); + foreach (var parameter in markdownInfo.Parameters) + { + sb.Append(parameter.ToHelpParameterOutput()); + } + if (markdownInfo.SupportsShouldProcess) + { + foreach (var parameter in SupportsShouldProcessParameters) + { + sb.Append(parameter.ToHelpParameterOutput()); + } + } + + sb.Append($"### CommonParameters{Environment.NewLine}This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## INPUTS{Environment.NewLine}{Environment.NewLine}"); + foreach (var input in markdownInfo.Inputs) + { + sb.Append($"### {input}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## OUTPUTS{Environment.NewLine}{Environment.NewLine}"); + foreach (var output in markdownInfo.Outputs) + { + sb.Append($"### {output}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## NOTES{Environment.NewLine}{Environment.NewLine}"); + if (markdownInfo.Aliases.Any()) + { + sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); + } + foreach (var alias in markdownInfo.Aliases) + { + sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); + } + + if (AddComplexInterfaceInfo) + { + if (markdownInfo.ComplexInterfaceInfos.Any()) + { + sb.Append($"{ComplexParameterHeader}{Environment.NewLine}"); + } + foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos) + { + sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}"); + } + + } + + sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); + foreach (var relatedLink in markdownInfo.RelatedLinks) + { + sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + } + + File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); + } + + WriteModulePage(moduleHelpInfo, markdownInfos, docsFolder); + } + + private static void WriteModulePage(PsModuleHelpInfo moduleInfo, MarkdownHelpInfo[] markdownInfos, string docsFolder) + { + var sb = new StringBuilder(); + sb.Append(moduleInfo.ToModulePageMetadataOutput()); + sb.Append($"# {moduleInfo.Name} Module{Environment.NewLine}"); + sb.Append($"## Description{Environment.NewLine}{moduleInfo.Description.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## {moduleInfo.Name} Cmdlets{Environment.NewLine}"); + foreach (var markdownInfo in markdownInfos) + { + sb.Append(markdownInfo.ToModulePageCmdletOutput()); + } + + File.WriteAllText(Path.Combine(docsFolder, $"{moduleInfo.Name}.md"), sb.ToString()); + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsFormatTypes.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsFormatTypes.cs new file mode 100644 index 000000000000..c86c28ffaa8b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsFormatTypes.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + internal class ViewParameters + { + public Type Type { get; } + public IEnumerable Properties { get; } + + public ViewParameters(Type type, IEnumerable properties) + { + Type = type; + Properties = properties; + } + } + + internal class PropertyFormat + { + public PropertyInfo Property { get; } + public FormatTableAttribute FormatTable { get; } + + public int? Index { get; } + public string Label { get; } + public int? Width { get; } + public PropertyOrigin? Origin { get; } + + public PropertyFormat(PropertyInfo propertyInfo) + { + Property = propertyInfo; + FormatTable = Property.GetCustomAttributes().FirstOrDefault(); + var origin = Property.GetCustomAttributes().FirstOrDefault(); + + Index = FormatTable?.HasIndex ?? false ? (int?)FormatTable.Index : null; + Label = FormatTable?.Label ?? propertyInfo.Name; + Width = FormatTable?.HasWidth ?? false ? (int?)FormatTable.Width : null; + // If we have an index, we don't want to use Origin. + Origin = FormatTable?.HasIndex ?? false ? null : origin?.Origin; + } + } + + [Serializable] + [XmlRoot(nameof(Configuration))] + public class Configuration + { + [XmlElement("ViewDefinitions")] + public ViewDefinitions ViewDefinitions { get; set; } + } + + [Serializable] + public class ViewDefinitions + { + //https://stackoverflow.com/a/10518657/294804 + [XmlElement("View")] + public List Views { get; set; } + } + + [Serializable] + public class View + { + [XmlElement(nameof(Name))] + public string Name { get; set; } + [XmlElement(nameof(ViewSelectedBy))] + public ViewSelectedBy ViewSelectedBy { get; set; } + [XmlElement(nameof(TableControl))] + public TableControl TableControl { get; set; } + } + + [Serializable] + public class ViewSelectedBy + { + [XmlElement(nameof(TypeName))] + public string TypeName { get; set; } + } + + [Serializable] + public class TableControl + { + [XmlElement(nameof(TableHeaders))] + public TableHeaders TableHeaders { get; set; } + [XmlElement(nameof(TableRowEntries))] + public TableRowEntries TableRowEntries { get; set; } + } + + [Serializable] + public class TableHeaders + { + [XmlElement("TableColumnHeader")] + public List TableColumnHeaders { get; set; } + } + + [Serializable] + public class TableColumnHeader + { + [XmlElement(nameof(Label))] + public string Label { get; set; } + [XmlElement(nameof(Width))] + public int? Width { get; set; } + + //https://stackoverflow.com/a/4095225/294804 + public bool ShouldSerializeWidth() => Width.HasValue; + } + + [Serializable] + public class TableRowEntries + { + [XmlElement(nameof(TableRowEntry))] + public TableRowEntry TableRowEntry { get; set; } + } + + [Serializable] + public class TableRowEntry + { + [XmlElement(nameof(TableColumnItems))] + public TableColumnItems TableColumnItems { get; set; } + } + + [Serializable] + public class TableColumnItems + { + [XmlElement("TableColumnItem")] + public List TableItems { get; set; } + } + + [Serializable] + public class TableColumnItem + { + [XmlElement(nameof(PropertyName))] + public string PropertyName { get; set; } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs new file mode 100644 index 000000000000..0ef4f1c19d5a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs @@ -0,0 +1,199 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + internal class HelpMetadataOutput + { + public MarkdownHelpInfo HelpInfo { get; } + + public HelpMetadataOutput(MarkdownHelpInfo helpInfo) + { + HelpInfo = helpInfo; + } + + public override string ToString() => $@"--- +external help file:{(!String.IsNullOrEmpty(HelpInfo.ExternalHelpFilename) ? $" {HelpInfo.ExternalHelpFilename}" : String.Empty)} +Module Name: {HelpInfo.ModuleName} +online version: {HelpInfo.OnlineVersion} +schema: {HelpInfo.Schema.ToString(3)} +--- + +"; + } + + internal class HelpSyntaxOutput + { + public MarkdownSyntaxHelpInfo SyntaxInfo { get; } + public bool HasMultipleParameterSets { get; } + + public HelpSyntaxOutput(MarkdownSyntaxHelpInfo syntaxInfo, bool hasMultipleParameterSets) + { + SyntaxInfo = syntaxInfo; + HasMultipleParameterSets = hasMultipleParameterSets; + } + + public override string ToString() + { + var psnText = HasMultipleParameterSets ? $"### {SyntaxInfo.ParameterSetName}{(SyntaxInfo.IsDefault ? " (Default)" : String.Empty)}{Environment.NewLine}" : String.Empty; + return $@"{psnText}``` +{SyntaxInfo.SyntaxText} +``` + +"; + } + } + + internal class HelpExampleOutput + { + private string ExampleTemplate = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + Environment.NewLine; + + private string ExampleTemplateWithOutput = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + "{6}" + Environment.NewLine + "{7}" + Environment.NewLine + Environment.NewLine + + "{8}" + Environment.NewLine + Environment.NewLine; + + public MarkdownExampleHelpInfo ExampleInfo { get; } + + public HelpExampleOutput(MarkdownExampleHelpInfo exampleInfo) + { + ExampleInfo = exampleInfo; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(ExampleInfo.Output)) + { + return string.Format(ExampleTemplate, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleInfo.Description.ToDescriptionFormat()); + } + else + { + return string.Format(ExampleTemplateWithOutput, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleOutputHeader, ExampleInfo.Output, ExampleOutputFooter, + ExampleInfo.Description.ToDescriptionFormat()); ; + } + } + } + + internal class HelpParameterOutput + { + public MarkdownParameterHelpInfo ParameterInfo { get; } + + public HelpParameterOutput(MarkdownParameterHelpInfo parameterInfo) + { + ParameterInfo = parameterInfo; + } + + public override string ToString() + { + var pipelineInputTypes = new[] + { + ParameterInfo.AcceptsPipelineByValue ? "ByValue" : String.Empty, + ParameterInfo.AcceptsPipelineByPropertyName ? "ByPropertyName" : String.Empty + }.JoinIgnoreEmpty(", "); + var pipelineInput = ParameterInfo.AcceptsPipelineByValue || ParameterInfo.AcceptsPipelineByPropertyName + ? $@"{true} ({pipelineInputTypes})" + : false.ToString(); + + return $@"### -{ParameterInfo.Name} +{ParameterInfo.Description.ToDescriptionFormat()} + +```yaml +Type: {ParameterInfo.Type.FullName} +Parameter Sets: {(ParameterInfo.HasAllParameterSets ? "(All)" : ParameterInfo.ParameterSetNames.JoinIgnoreEmpty(", "))} +Aliases:{(ParameterInfo.Aliases.Any() ? $" {ParameterInfo.Aliases.JoinIgnoreEmpty(", ")}" : String.Empty)} + +Required: {ParameterInfo.IsRequired} +Position: {ParameterInfo.Position} +Default value: {ParameterInfo.DefaultValue} +Accept pipeline input: {pipelineInput} +Accept wildcard characters: {ParameterInfo.AcceptsWildcardCharacters} +``` + +"; + } + } + + internal class ModulePageMetadataOutput + { + public PsModuleHelpInfo ModuleInfo { get; } + + private static string HelpLinkPrefix { get; } = @"https://learn.microsoft.com/powershell/module/"; + + public ModulePageMetadataOutput(PsModuleHelpInfo moduleInfo) + { + ModuleInfo = moduleInfo; + } + + public override string ToString() => $@"--- +Module Name: {ModuleInfo.Name} +Module Guid: {ModuleInfo.Guid} +Download Help Link: {HelpLinkPrefix}{ModuleInfo.Name.ToLowerInvariant()} +Help Version: 1.0.0.0 +Locale: en-US +--- + +"; + } + + internal class ModulePageCmdletOutput + { + public MarkdownHelpInfo HelpInfo { get; } + + public ModulePageCmdletOutput(MarkdownHelpInfo helpInfo) + { + HelpInfo = helpInfo; + } + + public override string ToString() => $@"### [{HelpInfo.CmdletName}]({HelpInfo.CmdletName}.md) +{HelpInfo.Synopsis.ToDescriptionFormat()} + +"; + } + + internal static class PsHelpOutputExtensions + { + public static string EscapeAngleBrackets(this string text) => text?.Replace("<", @"\<").Replace(">", @"\>"); + public static string ReplaceSentenceEndWithNewline(this string text) => text?.Replace(". ", $".{Environment.NewLine}").Replace(". ", $".{Environment.NewLine}"); + public static string ReplaceBrWithNewline(this string text) => text?.Replace("
", $"{Environment.NewLine}"); + public static string ToDescriptionFormat(this string text, bool escapeAngleBrackets = true) + { + var description = text?.ReplaceBrWithNewline(); + description = escapeAngleBrackets ? description?.EscapeAngleBrackets() : description; + return description?.ReplaceSentenceEndWithNewline().Trim(); + } + + public const string ExampleNameHeader = "### "; + public const string ExampleCodeHeader = "```powershell"; + public const string ExampleCodeFooter = "```"; + public const string ExampleOutputHeader = "```output"; + public const string ExampleOutputFooter = "```"; + + public static HelpMetadataOutput ToHelpMetadataOutput(this MarkdownHelpInfo helpInfo) => new HelpMetadataOutput(helpInfo); + + public static HelpSyntaxOutput ToHelpSyntaxOutput(this MarkdownSyntaxHelpInfo syntaxInfo, bool hasMultipleParameterSets) => new HelpSyntaxOutput(syntaxInfo, hasMultipleParameterSets); + + public static HelpExampleOutput ToHelpExampleOutput(this MarkdownExampleHelpInfo exampleInfo) => new HelpExampleOutput(exampleInfo); + + public static HelpParameterOutput ToHelpParameterOutput(this MarkdownParameterHelpInfo parameterInfo) => new HelpParameterOutput(parameterInfo); + + public static ModulePageMetadataOutput ToModulePageMetadataOutput(this PsModuleHelpInfo moduleInfo) => new ModulePageMetadataOutput(moduleInfo); + + public static ModulePageCmdletOutput ToModulePageCmdletOutput(this MarkdownHelpInfo helpInfo) => new ModulePageCmdletOutput(helpInfo); + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsHelpTypes.cs new file mode 100644 index 000000000000..39e932cabf0a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsHelpTypes.cs @@ -0,0 +1,202 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + internal class PsHelpInfo + { + public string CmdletName { get; } + public string ModuleName { get; } + public string Synopsis { get; } + public string Description { get; } + public string AlertText { get; } + public string Category { get; } + public PsHelpLinkInfo OnlineVersion { get; } + public PsHelpLinkInfo[] RelatedLinks { get; } + public bool? HasCommonParameters { get; } + public bool? HasWorkflowCommonParameters { get; } + + public PsHelpTypeInfo[] InputTypes { get; } + public PsHelpTypeInfo[] OutputTypes { get; } + public PsHelpExampleInfo[] Examples { get; set; } + public string[] Aliases { get; } + + public PsParameterHelpInfo[] Parameters { get; } + public PsHelpSyntaxInfo[] Syntax { get; } + + public object Component { get; } + public object Functionality { get; } + public object PsSnapIn { get; } + public object Role { get; } + public string NonTerminatingErrors { get; } + + public PsHelpInfo(PSObject helpObject = null) + { + helpObject = helpObject ?? new PSObject(); + CmdletName = helpObject.GetProperty("Name").NullIfEmpty() ?? helpObject.GetNestedProperty("details", "name"); + ModuleName = helpObject.GetProperty("ModuleName"); + Synopsis = helpObject.GetProperty("Synopsis"); + Description = helpObject.GetProperty("description").EmptyIfNull().ToDescriptionText().NullIfEmpty() ?? + helpObject.GetNestedProperty("details", "description").EmptyIfNull().ToDescriptionText(); + AlertText = helpObject.GetNestedProperty("alertSet", "alert").EmptyIfNull().ToDescriptionText(); + Category = helpObject.GetProperty("Category"); + HasCommonParameters = helpObject.GetProperty("CommonParameters").ToNullableBool(); + HasWorkflowCommonParameters = helpObject.GetProperty("WorkflowCommonParameters").ToNullableBool(); + + var links = helpObject.GetNestedProperty("relatedLinks", "navigationLink").EmptyIfNull().Select(nl => nl.ToLinkInfo()).ToArray(); + OnlineVersion = links.FirstOrDefault(l => l.Text?.ToLowerInvariant().StartsWith("online version:") ?? links.Length == 1); + RelatedLinks = links.Where(l => !l.Text?.ToLowerInvariant().StartsWith("online version:") ?? links.Length != 1).ToArray(); + + InputTypes = helpObject.GetNestedProperty("inputTypes", "inputType").EmptyIfNull().Select(it => it.ToTypeInfo()).ToArray(); + OutputTypes = helpObject.GetNestedProperty("returnValues", "returnValue").EmptyIfNull().Select(rv => rv.ToTypeInfo()).ToArray(); + Examples = helpObject.GetNestedProperty("examples", "example").EmptyIfNull().Select(e => e.ToExampleInfo()).ToArray(); + Aliases = helpObject.GetProperty("aliases").EmptyIfNull().Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); + + Parameters = helpObject.GetNestedProperty("parameters", "parameter").EmptyIfNull().Select(p => p.ToPsParameterHelpInfo()).ToArray(); + Syntax = helpObject.GetNestedProperty("syntax", "syntaxItem").EmptyIfNull().Select(si => si.ToSyntaxInfo()).ToArray(); + + Component = helpObject.GetProperty("Component"); + Functionality = helpObject.GetProperty("Functionality"); + PsSnapIn = helpObject.GetProperty("PSSnapIn"); + Role = helpObject.GetProperty("Role"); + NonTerminatingErrors = helpObject.GetProperty("nonTerminatingErrors"); + } + } + + internal class PsHelpTypeInfo + { + public string Name { get; } + public string Description { get; } + + public PsHelpTypeInfo(PSObject typeObject) + { + Name = typeObject.GetNestedProperty("type", "name").EmptyIfNull().Trim(); + Description = typeObject.GetProperty("description").EmptyIfNull().ToDescriptionText(); + } + } + + internal class PsHelpLinkInfo + { + public string Uri { get; } + public string Text { get; } + + public PsHelpLinkInfo(PSObject linkObject) + { + Uri = linkObject.GetProperty("uri"); + Text = linkObject.GetProperty("linkText"); + } + } + + internal class PsHelpSyntaxInfo + { + public string CmdletName { get; } + public PsParameterHelpInfo[] Parameters { get; } + + public PsHelpSyntaxInfo(PSObject syntaxObject) + { + CmdletName = syntaxObject.GetProperty("name"); + Parameters = syntaxObject.GetProperty("parameter").EmptyIfNull().Select(p => p.ToPsParameterHelpInfo()).ToArray(); + } + } + + internal class PsHelpExampleInfo + { + public string Title { get; } + public string Code { get; } + public string Output { get; } + public string Remarks { get; } + + public PsHelpExampleInfo(PSObject exampleObject) + { + Title = exampleObject.GetProperty("title"); + Code = exampleObject.GetProperty("code"); + Output = exampleObject.GetProperty("output"); + Remarks = exampleObject.GetProperty("remarks").EmptyIfNull().ToDescriptionText(); + } + public PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) + { + Title = markdownExample.Name; + Code = markdownExample.Code; + Output = markdownExample.Output; + Remarks = markdownExample.Description; + } + + public static implicit operator PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) => new PsHelpExampleInfo(markdownExample); + } + + internal class PsParameterHelpInfo + { + public string DefaultValueAsString { get; } + + public string Name { get; } + public string TypeName { get; } + public string Description { get; } + public string SupportsPipelineInput { get; } + public string PositionText { get; } + public string[] ParameterSetNames { get; } + public string[] Aliases { get; } + + public bool? SupportsGlobbing { get; } + public bool? IsRequired { get; } + public bool? IsVariableLength { get; } + public bool? IsDynamic { get; } + + public PsParameterHelpInfo(PSObject parameterHelpObject = null) + { + parameterHelpObject = parameterHelpObject ?? new PSObject(); + DefaultValueAsString = parameterHelpObject.GetProperty("defaultValue"); + Name = parameterHelpObject.GetProperty("name"); + TypeName = parameterHelpObject.GetProperty("parameterValue").NullIfEmpty() ?? parameterHelpObject.GetNestedProperty("type", "name"); + Description = parameterHelpObject.GetProperty("Description").EmptyIfNull().ToDescriptionText(); + SupportsPipelineInput = parameterHelpObject.GetProperty("pipelineInput"); + PositionText = parameterHelpObject.GetProperty("position"); + ParameterSetNames = parameterHelpObject.GetProperty("parameterSetName").EmptyIfNull().Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries); + Aliases = parameterHelpObject.GetProperty("aliases").EmptyIfNull().Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries); + + SupportsGlobbing = parameterHelpObject.GetProperty("globbing").ToNullableBool(); + IsRequired = parameterHelpObject.GetProperty("required").ToNullableBool(); + IsVariableLength = parameterHelpObject.GetProperty("variableLength").ToNullableBool(); + IsDynamic = parameterHelpObject.GetProperty("isDynamic").ToNullableBool(); + } + } + + internal class PsModuleHelpInfo + { + public string Name { get; } + public Guid Guid { get; } + public string Description { get; } + + public PsModuleHelpInfo(PSModuleInfo moduleInfo) + : this(moduleInfo?.Name ?? String.Empty, moduleInfo?.Guid ?? Guid.NewGuid(), moduleInfo?.Description ?? String.Empty) + { + } + + public PsModuleHelpInfo(string name, Guid guid, string description) + { + Name = name; + Guid = guid; + Description = description; + } + } + + internal static class HelpTypesExtensions + { + public static PsHelpInfo ToPsHelpInfo(this PSObject helpObject) => new PsHelpInfo(helpObject); + public static PsParameterHelpInfo ToPsParameterHelpInfo(this PSObject parameterHelpObject) => new PsParameterHelpInfo(parameterHelpObject); + + public static string ToDescriptionText(this IEnumerable descriptionObject) => descriptionObject != null + ? String.Join(Environment.NewLine, descriptionObject.Select(dl => dl.GetProperty("Text").EmptyIfNull())).NullIfWhiteSpace() + : null; + public static PsHelpTypeInfo ToTypeInfo(this PSObject typeObject) => new PsHelpTypeInfo(typeObject); + public static PsHelpExampleInfo ToExampleInfo(this PSObject exampleObject) => new PsHelpExampleInfo(exampleObject); + public static PsHelpLinkInfo ToLinkInfo(this PSObject linkObject) => new PsHelpLinkInfo(linkObject); + public static PsHelpSyntaxInfo ToSyntaxInfo(this PSObject syntaxObject) => new PsHelpSyntaxInfo(syntaxObject); + public static PsModuleHelpInfo ToModuleInfo(this PSModuleInfo moduleInfo) => new PsModuleHelpInfo(moduleInfo); + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs new file mode 100644 index 000000000000..256b562eb4b8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -0,0 +1,294 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + internal class MarkdownHelpInfo + { + public string ExternalHelpFilename { get; } + public string ModuleName { get; } + public string OnlineVersion { get; } + public Version Schema { get; } + + public string CmdletName { get; } + public string[] Aliases { get; } + public string Synopsis { get; } + public string Description { get; } + + public MarkdownSyntaxHelpInfo[] SyntaxInfos { get; } + public MarkdownExampleHelpInfo[] Examples { get; } + public MarkdownParameterHelpInfo[] Parameters { get; } + + public string[] Inputs { get; } + public string[] Outputs { get; } + public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } + public string[] RelatedLinks { get; } + + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + + public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string externalHelpFilename = "") + { + ExternalHelpFilename = externalHelpFilename; + ModuleName = variantGroup.RootModuleName != "" ? variantGroup.RootModuleName : variantGroup.ModuleName; + var helpInfo = variantGroup.HelpInfo; + var commentInfo = variantGroup.CommentInfo; + Schema = Version.Parse("2.0.0"); + + CmdletName = variantGroup.CmdletName; + Aliases = (variantGroup.Aliases.NullIfEmpty() ?? helpInfo.Aliases).Where(a => a != "None").ToArray(); + Synopsis = commentInfo.Synopsis; + Description = commentInfo.Description; + + SyntaxInfos = variantGroup.Variants + .Select(v => new MarkdownSyntaxHelpInfo(v, variantGroup.ParameterGroups, v.VariantName == variantGroup.DefaultParameterSetName)) + .OrderByDescending(v => v.IsDefault).ThenBy(v => v.ParameterSetName).ToArray(); + Examples = GetExamplesFromMarkdown(examplesFolder).NullIfEmpty() + ?? helpInfo.Examples.Select(e => e.ToExampleHelpInfo()).ToArray().NullIfEmpty() + ?? DefaultExampleHelpInfos; + + Parameters = variantGroup.ParameterGroups + .Where(pg => !pg.DontShow && !pg.Parameters.All(p => p.IsHidden())) + .Select(pg => new MarkdownParameterHelpInfo( + variantGroup.Variants.SelectMany(v => v.HelpInfo.Parameters).Where(phi => phi.Name == pg.ParameterName).ToArray(), pg)) + .OrderBy(phi => phi.Name).ToArray(); + + Inputs = commentInfo.Inputs; + Outputs = commentInfo.Outputs; + + ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; + OnlineVersion = commentInfo.OnlineVersion; + RelatedLinks = commentInfo.RelatedLinks; + + SupportsShouldProcess = variantGroup.SupportsShouldProcess; + SupportsPaging = variantGroup.SupportsPaging; + } + + private MarkdownExampleHelpInfo[] GetExamplesFromMarkdown(string examplesFolder) + { + var filePath = Path.Combine(examplesFolder, $"{CmdletName}.md"); + if (!Directory.Exists(examplesFolder) || !File.Exists(filePath)) return null; + + var lines = File.ReadAllLines(filePath); + var nameIndices = lines.Select((l, i) => l.StartsWith(ExampleNameHeader) ? i : -1).Where(i => i != -1).ToArray(); + //https://codereview.stackexchange.com/a/187148/68772 + var indexCountGroups = nameIndices.Skip(1).Append(lines.Length).Zip(nameIndices, (next, current) => (NameIndex: current, LineCount: next - current)); + var exampleGroups = indexCountGroups.Select(icg => lines.Skip(icg.NameIndex).Take(icg.LineCount).ToArray()); + return exampleGroups.Select(eg => + { + var name = eg.First().Replace(ExampleNameHeader, String.Empty); + var codeStartIndex = eg.Select((l, i) => l.StartsWith(ExampleCodeHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var codeEndIndex = eg.Select((l, i) => l.StartsWith(ExampleCodeFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i != codeStartIndex); + var code = codeStartIndex.HasValue && codeEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(codeStartIndex.Value + 1).Take(codeEndIndex.Value - (codeStartIndex.Value + 1))) + : String.Empty; + var outputStartIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var outputEndIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i > outputStartIndex); + var output = outputStartIndex.HasValue && outputEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(outputStartIndex.Value + 1).Take(outputEndIndex.Value - (outputStartIndex.Value + 1))) + : String.Empty; + var descriptionStartIndex = (outputEndIndex ?? (codeEndIndex ?? 0)) + 1; + descriptionStartIndex = String.IsNullOrWhiteSpace(eg[descriptionStartIndex]) ? descriptionStartIndex + 1 : descriptionStartIndex; + var descriptionEndIndex = eg.Length - 1; + descriptionEndIndex = String.IsNullOrWhiteSpace(eg[descriptionEndIndex]) ? descriptionEndIndex - 1 : descriptionEndIndex; + var description = String.Join(Environment.NewLine, eg.Skip(descriptionStartIndex).Take((descriptionEndIndex + 1) - descriptionStartIndex)); + return new MarkdownExampleHelpInfo(name, code, output, description); + }).ToArray(); + } + } + + internal class MarkdownSyntaxHelpInfo + { + public Variant Variant { get; } + public bool IsDefault { get; } + public string ParameterSetName { get; } + public Parameter[] Parameters { get; } + public string SyntaxText { get; } + + public MarkdownSyntaxHelpInfo(Variant variant, ParameterGroup[] parameterGroups, bool isDefault) + { + Variant = variant; + IsDefault = isDefault; + ParameterSetName = Variant.VariantName; + Parameters = Variant.Parameters + .Where(p => !p.DontShow && !p.IsHidden()).OrderByDescending(p => p.IsMandatory) + //https://stackoverflow.com/a/6461526/294804 + .ThenByDescending(p => p.Position.HasValue).ThenBy(p => p.Position) + // Use the OrderCategory of the parameter group because the final order category is the highest of the group, and not the order category of the individual parameters from the variants. + .ThenBy(p => parameterGroups.First(pg => pg.ParameterName == p.ParameterName).OrderCategory).ThenBy(p => p.ParameterName).ToArray(); + SyntaxText = CreateSyntaxFormat(); + } + + //https://github.com/PowerShell/platyPS/blob/a607a926bfffe1e1a1e53c19e0057eddd0c07611/src/Markdown.MAML/Renderer/Markdownv2Renderer.cs#L29-L32 + private const int SyntaxLineWidth = 110; + private string CreateSyntaxFormat() + { + var parameterStrings = Parameters.Select(p => p.ToPropertySyntaxOutput().ToString()); + if (Variant.SupportsShouldProcess) + { + parameterStrings = parameterStrings.Append(" [-Confirm]").Append(" [-WhatIf]"); + } + parameterStrings = parameterStrings.Append(" []"); + + var lines = new List(20); + return parameterStrings.Aggregate(Variant.CmdletName, (current, ps) => + { + var combined = current + ps; + if (combined.Length <= SyntaxLineWidth) return combined; + + lines.Add(current); + return ps; + }, last => + { + lines.Add(last); + return String.Join(Environment.NewLine, lines); + }); + } + } + + internal class MarkdownExampleHelpInfo + { + public string Name { get; } + public string Code { get; } + public string Output { get; } + public string Description { get; } + + public MarkdownExampleHelpInfo(string name, string code, string output, string description) + { + Name = name; + Code = code; + Output = output; + Description = description; + } + } + + internal class MarkdownParameterHelpInfo + { + public string Name { get; set; } + public string Description { get; set; } + public Type Type { get; set; } + public string Position { get; set; } + public string DefaultValue { get; set; } + + public bool HasAllParameterSets { get; set; } + public string[] ParameterSetNames { get; set; } + public string[] Aliases { get; set; } + + public bool IsRequired { get; set; } + public bool IsDynamic { get; set; } + public bool AcceptsPipelineByValue { get; set; } + public bool AcceptsPipelineByPropertyName { get; set; } + public bool AcceptsWildcardCharacters { get; set; } + + // For use by common parameters that have no backing data in the objects themselves. + public MarkdownParameterHelpInfo() { } + + public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, ParameterGroup parameterGroup) + { + Name = parameterGroup.ParameterName; + Description = parameterGroup.Description.NullIfEmpty() + ?? parameterHelpInfos.Select(phi => phi.Description).FirstOrDefault(d => !String.IsNullOrEmpty(d)).EmptyIfNull(); + Type = parameterGroup.ParameterType; + Position = parameterGroup.FirstPosition?.ToString() + ?? parameterHelpInfos.Select(phi => phi.PositionText).FirstOrDefault(d => !String.IsNullOrEmpty(d)).ToUpperFirstCharacter().NullIfEmpty() + ?? "Named"; + // This no longer uses firstHelpInfo.DefaultValueAsString since it seems to be broken. For example, it has a value of 0 for Int32, but no default value was declared. + DefaultValue = parameterGroup.DefaultInfo?.Script ?? "None"; + + HasAllParameterSets = parameterGroup.HasAllVariants; + ParameterSetNames = (parameterGroup.Parameters.Select(p => p.VariantName).ToArray().NullIfEmpty() + ?? parameterHelpInfos.SelectMany(phi => phi.ParameterSetNames).Distinct()) + .OrderBy(psn => psn).ToArray(); + Aliases = parameterGroup.Aliases.NullIfEmpty() ?? parameterHelpInfos.SelectMany(phi => phi.Aliases).ToArray(); + + IsRequired = parameterHelpInfos.Select(phi => phi.IsRequired).FirstOrDefault(r => r == true) ?? parameterGroup.Parameters.Any(p => p.IsMandatory); + IsDynamic = parameterHelpInfos.Select(phi => phi.IsDynamic).FirstOrDefault(d => d == true) ?? false; + AcceptsPipelineByValue = parameterHelpInfos.Select(phi => phi.SupportsPipelineInput?.Contains("ByValue")).FirstOrDefault(bv => bv == true) ?? parameterGroup.ValueFromPipeline; + AcceptsPipelineByPropertyName = parameterHelpInfos.Select(phi => phi.SupportsPipelineInput?.Contains("ByPropertyName")).FirstOrDefault(bv => bv == true) ?? parameterGroup.ValueFromPipelineByPropertyName; + AcceptsWildcardCharacters = parameterGroup.SupportsWildcards; + } + } + + internal static class MarkdownTypesExtensions + { + public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Output, exampleInfo.Remarks); + + public static MarkdownExampleHelpInfo[] DefaultExampleHelpInfos = + { + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + }; + + public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = + { + new MarkdownParameterHelpInfo + { + Name = "Confirm", + Description ="Prompts you for confirmation before running the cmdlet.", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new [] { "cf" } + }, + new MarkdownParameterHelpInfo + { + Name = "WhatIf", + Description ="Shows what would happen if the cmdlet runs. The cmdlet is not run.", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new [] { "wi" } + } + }; + + public static MarkdownParameterHelpInfo[] SupportsPagingParameters = + { + new MarkdownParameterHelpInfo + { + Name = "First", + Description ="Gets only the first 'n' objects.", + Type = typeof(ulong), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + }, + new MarkdownParameterHelpInfo + { + Name = "IncludeTotalCount", + Description ="Reports the number of objects in the data set (an integer) followed by the objects. If the cmdlet cannot determine the total count, it returns \"Unknown total count\".", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + }, + new MarkdownParameterHelpInfo + { + Name = "Skip", + Description ="Ignores the first 'n' objects and then gets the remaining objects.", + Type = typeof(ulong), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + } + }; + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsProxyOutputs.cs new file mode 100644 index 000000000000..44c55da04bfe --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -0,0 +1,635 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Linq; +using System.Management.Automation; +using System.Text; +using System.Text.RegularExpressions; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + internal class OutputTypeOutput + { + public PSTypeName[] OutputTypes { get; } + + public OutputTypeOutput(IEnumerable outputTypes) + { + OutputTypes = outputTypes.ToArray(); + } + + public override string ToString() => OutputTypes != null && OutputTypes.Any() ? $"[OutputType({OutputTypes.Select(ot => $"[{ot}]").JoinIgnoreEmpty(ItemSeparator)})]{Environment.NewLine}" : String.Empty; + } + + internal class CmdletBindingOutput + { + public VariantGroup VariantGroup { get; } + + public CmdletBindingOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + } + + public override string ToString() + { + var dpsText = VariantGroup.DefaultParameterSetName.IsValidDefaultParameterSetName() ? $"DefaultParameterSetName='{VariantGroup.DefaultParameterSetName}'" : String.Empty; + var sspText = VariantGroup.SupportsShouldProcess ? $"SupportsShouldProcess{ItemSeparator}ConfirmImpact='Medium'" : String.Empty; + var pbText = $"PositionalBinding={false.ToPsBool()}"; + var propertyText = new[] { dpsText, pbText, sspText }.JoinIgnoreEmpty(ItemSeparator); + return $"[CmdletBinding({propertyText})]{Environment.NewLine}"; + } + } + + internal class ParameterOutput + { + public Parameter Parameter { get; } + public bool HasMultipleVariantsInVariantGroup { get; } + public bool HasAllVariantsInParameterGroup { get; } + + public ParameterOutput(Parameter parameter, bool hasMultipleVariantsInVariantGroup, bool hasAllVariantsInParameterGroup) + { + Parameter = parameter; + HasMultipleVariantsInVariantGroup = hasMultipleVariantsInVariantGroup; + HasAllVariantsInParameterGroup = hasAllVariantsInParameterGroup; + } + + public override string ToString() + { + var psnText = HasMultipleVariantsInVariantGroup && !HasAllVariantsInParameterGroup ? $"ParameterSetName='{Parameter.VariantName}'" : String.Empty; + var positionText = Parameter.Position != null ? $"Position={Parameter.Position}" : String.Empty; + var mandatoryText = Parameter.IsMandatory ? "Mandatory" : String.Empty; + var dontShowText = Parameter.DontShow ? "DontShow" : String.Empty; + var vfpText = Parameter.ValueFromPipeline ? "ValueFromPipeline" : String.Empty; + var vfpbpnText = Parameter.ValueFromPipelineByPropertyName ? "ValueFromPipelineByPropertyName" : String.Empty; + var propertyText = new[] { psnText, positionText, mandatoryText, dontShowText, vfpText, vfpbpnText }.JoinIgnoreEmpty(ItemSeparator); + return $"{Indent}[Parameter({propertyText})]{Environment.NewLine}"; + } + } + + internal class AliasOutput + { + public string[] Aliases { get; } + public bool IncludeIndent { get; } + + public AliasOutput(string[] aliases, bool includeIndent = false) + { + Aliases = aliases; + IncludeIndent = includeIndent; + } + + public override string ToString() => Aliases?.Any() ?? false ? $"{(IncludeIndent ? Indent : String.Empty)}[Alias({Aliases.Select(an => $"'{an}'").JoinIgnoreEmpty(ItemSeparator)})]{Environment.NewLine}" : String.Empty; + } + + internal class ValidateNotNullOutput + { + public bool HasValidateNotNull { get; } + + public ValidateNotNullOutput(bool hasValidateNotNull) + { + HasValidateNotNull = hasValidateNotNull; + } + + public override string ToString() => HasValidateNotNull ? $"{Indent}[ValidateNotNull()]{Environment.NewLine}" : String.Empty; + } + + internal class AllowEmptyArrayOutput + { + public bool HasAllowEmptyArray { get; } + + public AllowEmptyArrayOutput(bool hasAllowEmptyArray) + { + HasAllowEmptyArray = hasAllowEmptyArray; + } + + public override string ToString() => HasAllowEmptyArray ? $"{Indent}[AllowEmptyCollection()]{Environment.NewLine}" : String.Empty; + } + internal class ArgumentCompleterOutput + { + public CompleterInfo CompleterInfo { get; } + + public ArgumentCompleterOutput(CompleterInfo completerInfo) + { + CompleterInfo = completerInfo; + } + + public override string ToString() => CompleterInfo != null + ? $"{Indent}[ArgumentCompleter({(CompleterInfo.IsTypeCompleter ? $"[{CompleterInfo.Type.Unwrap().ToPsType()}]" : $"{{{CompleterInfo.Script.ToPsSingleLine("; ")}}}")})]{Environment.NewLine}" + : String.Empty; + } + + internal class DefaultInfoOutput + { + public bool HasDefaultInfo { get; } + public DefaultInfo DefaultInfo { get; } + + public DefaultInfoOutput(ParameterGroup parameterGroup) + { + HasDefaultInfo = parameterGroup.HasDefaultInfo; + DefaultInfo = parameterGroup.DefaultInfo; + } + + public override string ToString() + { + var nameText = !String.IsNullOrEmpty(DefaultInfo?.Name) ? $"Name='{DefaultInfo?.Name}'" : String.Empty; + var descriptionText = !String.IsNullOrEmpty(DefaultInfo?.Description) ? $"Description='{DefaultInfo?.Description.ToPsStringLiteral()}'" : String.Empty; + var scriptText = !String.IsNullOrEmpty(DefaultInfo?.Script) ? $"Script='{DefaultInfo?.Script.ToPsSingleLine("; ")}'" : String.Empty; + var propertyText = new[] { nameText, descriptionText, scriptText }.JoinIgnoreEmpty(ItemSeparator); + return HasDefaultInfo ? $"{Indent}[{typeof(DefaultInfoAttribute).ToPsAttributeType()}({propertyText})]{Environment.NewLine}" : String.Empty; + } + } + + internal class ParameterTypeOutput + { + public Type ParameterType { get; } + + public ParameterTypeOutput(Type parameterType) + { + ParameterType = parameterType; + } + + public override string ToString() => $"{Indent}[{ParameterType.ToPsType()}]{Environment.NewLine}"; + } + + internal class ParameterNameOutput + { + public string ParameterName { get; } + public bool IsLast { get; } + + public ParameterNameOutput(string parameterName, bool isLast) + { + ParameterName = parameterName; + IsLast = isLast; + } + + public override string ToString() => $"{Indent}${{{ParameterName}}}{(IsLast ? String.Empty : $",{Environment.NewLine}")}{Environment.NewLine}"; + } + + internal class BaseOutput + { + public VariantGroup VariantGroup { get; } + + protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + } + public string ClearTelemetryContext() + { + return (!VariantGroup.IsInternal && IsAzure) ? $@"{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()" : ""; + } + } + + internal class BeginOutput : BaseOutput + { + public BeginOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + public string GetProcessCustomAttributesAtRuntime() + { + return VariantGroup.IsInternal ? "" : IsAzure ? $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet] +{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) +{Indent}{Indent}}}" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; + } + + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() +{Indent}{Indent}}} +{Indent}{Indent}$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}{Indent}if ($internalCalledCmdlets -eq '') {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' +{Indent}{Indent}}} +"; + } + return ""; + } + public override string ToString() => $@"begin {{ +{Indent}try {{ +{Indent}{Indent}$outBuffer = $null +{Indent}{Indent}if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {{ +{Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 +{Indent}{Indent}}} +{Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName +{GetTelemetry()} +{GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} +{GetProcessCustomAttributesAtRuntime()} +{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} +{Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) +{Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +}} + +"; + + private string GetParameterSetToCmdletMapping() + { + var sb = new StringBuilder(); + sb.AppendLine($"{Indent}{Indent}$mapping = @{{"); + foreach (var variant in VariantGroup.Variants) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}{variant.VariantName} = '{variant.PrivateModuleName}\{variant.PrivateCmdletName}';"); + } + sb.Append($"{Indent}{Indent}}}"); + return sb.ToString(); + } + + private string GetDefaultValuesStatements() + { + var defaultInfos = VariantGroup.ParameterGroups.Where(pg => pg.HasDefaultInfo).Select(pg => pg.DefaultInfo).ToArray(); + var sb = new StringBuilder(); + + foreach (var defaultInfo in defaultInfos) + { + var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); + var parameterName = defaultInfo.ParameterGroup.ParameterName; + sb.AppendLine(); + //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to + //override default value set in required readme + if ("SubscriptionId".Equals(parameterName)) + { + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); + sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); + sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.AppendLine($"{Indent}{Indent}{Indent}}}"); + sb.Append($"{Indent}{Indent}}}"); + } + else + { + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.Append($"{Indent}{Indent}}}"); + } + } + return sb.ToString(); + } + } + + internal class ProcessOutput : BaseOutput + { + public ProcessOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetFinally() + { + if (IsAzure && !VariantGroup.IsInternal) + { + return $@" +{Indent}finally {{ +{Indent}{Indent}$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}}} +"; + } + return ""; + } + public override string ToString() => $@"process {{ +{Indent}try {{ +{Indent}{Indent}$steppablePipeline.Process($_) +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +{GetFinally()} +}} +"; + } + + internal class EndOutput : BaseOutput + { + public EndOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}{Indent}}} +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId +"; + } + return ""; + } + public override string ToString() => $@"end {{ +{Indent}try {{ +{Indent}{Indent}$steppablePipeline.End() +{GetTelemetry()} +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +}} +"; + } + + internal class HelpCommentOutput + { + public VariantGroup VariantGroup { get; } + public CommentInfo CommentInfo { get; } + + public HelpCommentOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + CommentInfo = variantGroup.CommentInfo; + } + + public override string ToString() + { + var inputs = String.Join(Environment.NewLine, CommentInfo.Inputs.Select(i => $".Inputs{Environment.NewLine}{i}")); + var inputsText = !String.IsNullOrEmpty(inputs) ? $"{Environment.NewLine}{inputs}" : String.Empty; + var outputs = String.Join(Environment.NewLine, CommentInfo.Outputs.Select(o => $".Outputs{Environment.NewLine}{o}")); + var outputsText = !String.IsNullOrEmpty(outputs) ? $"{Environment.NewLine}{outputs}" : String.Empty; + var notes = String.Join($"{Environment.NewLine}{Environment.NewLine}", VariantGroup.ComplexInterfaceInfos.Select(cii => cii.ToNoteOutput())); + var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; + var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); + var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var examples = ""; + foreach (var example in VariantGroup.HelpInfo.Examples) + { + examples = examples + ".Example" + "\r\n" + example.Code + "\r\n"; + } + return $@"<# +.Synopsis +{CommentInfo.Synopsis.ToDescriptionFormat(false)} +.Description +{CommentInfo.Description.ToDescriptionFormat(false)} +{examples}{inputsText}{outputsText}{notesText} +.Link +{CommentInfo.OnlineVersion}{relatedLinksText} +#> +"; + } + } + + internal class ParameterDescriptionOutput + { + public string Description { get; } + + public ParameterDescriptionOutput(string description) + { + Description = description; + } + + public override string ToString() => !String.IsNullOrEmpty(Description) + ? Description.ToDescriptionFormat(false).NormalizeNewLines() + .Split(new[] { Environment.NewLine }, StringSplitOptions.None) + .Aggregate(String.Empty, (c, n) => c + $"{Indent}# {n}{Environment.NewLine}") + : String.Empty; + } + + internal class ProfileOutput + { + public string ProfileName { get; } + + public ProfileOutput(string profileName) + { + ProfileName = profileName; + } + + public override string ToString() => ProfileName != NoProfiles ? $"[{typeof(ProfileAttribute).ToPsAttributeType()}('{ProfileName}')]{Environment.NewLine}" : String.Empty; + } + + internal class DescriptionOutput + { + public string Description { get; } + + public DescriptionOutput(string description) + { + Description = description; + } + + public override string ToString() => !String.IsNullOrEmpty(Description) ? $"[{typeof(DescriptionAttribute).ToPsAttributeType()}('{Description.ToPsStringLiteral()}')]{Environment.NewLine}" : String.Empty; + } + + internal class ParameterCategoryOutput + { + public ParameterCategory Category { get; } + + public ParameterCategoryOutput(ParameterCategory category) + { + Category = category; + } + + public override string ToString() => $"{Indent}[{typeof(CategoryAttribute).ToPsAttributeType()}('{Category}')]{Environment.NewLine}"; + } + + internal class InfoOutput + { + public InfoAttribute Info { get; } + public Type ParameterType { get; } + + public InfoOutput(InfoAttribute info, Type parameterType) + { + Info = info; + ParameterType = parameterType; + } + + public override string ToString() + { + // Rendering of InfoAttribute members that are not used currently + /*var serializedNameText = Info.SerializedName != null ? $"SerializedName='{Info.SerializedName}'" : String.Empty; + var readOnlyText = Info.ReadOnly ? "ReadOnly" : String.Empty; + var descriptionText = !String.IsNullOrEmpty(Info.Description) ? $"Description='{Info.Description.ToPsStringLiteral()}'" : String.Empty;*/ + + var requiredText = Info.Required ? "Required" : String.Empty; + var unwrappedType = ParameterType.Unwrap(); + var hasValidPossibleTypes = Info.PossibleTypes.Any(pt => pt != unwrappedType); + var possibleTypesText = hasValidPossibleTypes + ? $"PossibleTypes=({Info.PossibleTypes.Select(pt => $"[{pt.ToPsType()}]").JoinIgnoreEmpty(ItemSeparator)})" + : String.Empty; + var propertyText = new[] { /*serializedNameText, */requiredText,/* readOnlyText,*/ possibleTypesText/*, descriptionText*/ }.JoinIgnoreEmpty(ItemSeparator); + return hasValidPossibleTypes ? $"{Indent}[{typeof(InfoAttribute).ToPsAttributeType()}({propertyText})]{Environment.NewLine}" : String.Empty; + } + } + + internal class PropertySyntaxOutput + { + public string ParameterName { get; } + public Type ParameterType { get; } + public bool IsMandatory { get; } + public int? Position { get; } + + public bool IncludeSpace { get; } + public bool IncludeDash { get; } + + public PropertySyntaxOutput(Parameter parameter) + { + ParameterName = parameter.ParameterName; + ParameterType = parameter.ParameterType; + IsMandatory = parameter.IsMandatory; + Position = parameter.Position; + IncludeSpace = true; + IncludeDash = true; + } + + public PropertySyntaxOutput(ComplexInterfaceInfo complexInterfaceInfo) + { + ParameterName = complexInterfaceInfo.Name; + ParameterType = complexInterfaceInfo.Type; + IsMandatory = complexInterfaceInfo.Required; + Position = null; + IncludeSpace = false; + IncludeDash = false; + } + + public override string ToString() + { + var leftOptional = !IsMandatory ? "[" : String.Empty; + var leftPositional = Position != null ? "[" : String.Empty; + var rightPositional = Position != null ? "]" : String.Empty; + var type = ParameterType != typeof(SwitchParameter) ? $" <{ParameterType.ToSyntaxTypeName()}>" : String.Empty; + var rightOptional = !IsMandatory ? "]" : String.Empty; + var space = IncludeSpace ? " " : String.Empty; + var dash = IncludeDash ? "-" : String.Empty; + return $"{space}{leftOptional}{leftPositional}{dash}{ParameterName}{rightPositional}{type}{rightOptional}"; + } + } + + internal static class PsProxyOutputExtensions + { + public const string NoParameters = "__NoParameters"; + + public const string AllParameterSets = "__AllParameterSets"; + + public const string HalfIndent = " "; + + public const string Indent = HalfIndent + HalfIndent; + + public const string ItemSeparator = ", "; + + public static readonly string ComplexParameterHeader = $"COMPLEX PARAMETER PROPERTIES{Environment.NewLine}{Environment.NewLine}To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.{Environment.NewLine}{Environment.NewLine}"; + + public static string ToPsBool(this bool value) => $"${value.ToString().ToLowerInvariant()}"; + + public static string ToPsType(this Type type) + { + var regex = new Regex(@"^(.*)`{1}\d+(.*)$"); + var typeText = type.ToString(); + var match = regex.Match(typeText); + return match.Success ? $"{match.Groups[1]}{match.Groups[2]}" : typeText; + } + + public static string ToPsAttributeType(this Type type) => type.ToPsType().RemoveEnd("Attribute"); + + // https://stackoverflow.com/a/5284606/294804 + private static string RemoveEnd(this string text, string suffix) => text.EndsWith(suffix) ? text.Substring(0, text.Length - suffix.Length) : text; + + public static string ToPsSingleLine(this string value, string replacer = " ") => value.ReplaceNewLines(replacer, new[] { "
", "\r\n", "\n" }); + + public static string ToPsStringLiteral(this string value) => value?.Replace("'", "''").Replace("‘", "''").Replace("’", "''").ToPsSingleLine().Trim() ?? String.Empty; + + public static string JoinIgnoreEmpty(this IEnumerable values, string separator) => String.Join(separator, values?.Where(v => !String.IsNullOrEmpty(v))); + + // https://stackoverflow.com/a/41961738/294804 + public static string ToSyntaxTypeName(this Type type) + { + if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + return $"{type.GetGenericArguments().First().ToSyntaxTypeName()}?"; + } + + if (type.IsGenericType) + { + var genericTypes = String.Join(ItemSeparator, type.GetGenericArguments().Select(ToSyntaxTypeName)); + return $"{type.Name.Split('`').First()}<{genericTypes}>"; + } + + return type.Name; + } + + public static OutputTypeOutput ToOutputTypeOutput(this IEnumerable outputTypes) => new OutputTypeOutput(outputTypes); + + public static CmdletBindingOutput ToCmdletBindingOutput(this VariantGroup variantGroup) => new CmdletBindingOutput(variantGroup); + + public static ParameterOutput ToParameterOutput(this Parameter parameter, bool hasMultipleVariantsInVariantGroup, bool hasAllVariantsInParameterGroup) => new ParameterOutput(parameter, hasMultipleVariantsInVariantGroup, hasAllVariantsInParameterGroup); + + public static AliasOutput ToAliasOutput(this string[] aliases, bool includeIndent = false) => new AliasOutput(aliases, includeIndent); + + public static ValidateNotNullOutput ToValidateNotNullOutput(this bool hasValidateNotNull) => new ValidateNotNullOutput(hasValidateNotNull); + + public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); + + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + + public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); + + public static ParameterTypeOutput ToParameterTypeOutput(this Type parameterType) => new ParameterTypeOutput(parameterType); + + public static ParameterNameOutput ToParameterNameOutput(this string parameterName, bool isLast) => new ParameterNameOutput(parameterName, isLast); + + public static BeginOutput ToBeginOutput(this VariantGroup variantGroup) => new BeginOutput(variantGroup); + + public static ProcessOutput ToProcessOutput(this VariantGroup variantGroup) => new ProcessOutput(variantGroup); + + public static EndOutput ToEndOutput(this VariantGroup variantGroup) => new EndOutput(variantGroup); + + public static HelpCommentOutput ToHelpCommentOutput(this VariantGroup variantGroup) => new HelpCommentOutput(variantGroup); + + public static ParameterDescriptionOutput ToParameterDescriptionOutput(this string description) => new ParameterDescriptionOutput(description); + + public static ProfileOutput ToProfileOutput(this string profileName) => new ProfileOutput(profileName); + + public static DescriptionOutput ToDescriptionOutput(this string description) => new DescriptionOutput(description); + + public static ParameterCategoryOutput ToParameterCategoryOutput(this ParameterCategory category) => new ParameterCategoryOutput(category); + + public static PropertySyntaxOutput ToPropertySyntaxOutput(this Parameter parameter) => new PropertySyntaxOutput(parameter); + + public static PropertySyntaxOutput ToPropertySyntaxOutput(this ComplexInterfaceInfo complexInterfaceInfo) => new PropertySyntaxOutput(complexInterfaceInfo); + + public static InfoOutput ToInfoOutput(this InfoAttribute info, Type parameterType) => new InfoOutput(info, parameterType); + + public static string ToNoteOutput(this ComplexInterfaceInfo complexInterfaceInfo, string currentIndent = "", bool includeDashes = false, bool includeBackticks = false, bool isFirst = true) + { + string RenderProperty(ComplexInterfaceInfo info, string indent, bool dash, bool backtick) => + $"{indent}{(dash ? "- " : String.Empty)}{(backtick ? "`" : String.Empty)}{info.ToPropertySyntaxOutput()}{(backtick ? "`" : String.Empty)}: {info.Description}"; + + var nested = complexInterfaceInfo.NestedInfos.Select(ni => + { + var nestedIndent = $"{currentIndent}{HalfIndent}"; + return ni.IsComplexInterface + ? ni.ToNoteOutput(nestedIndent, includeDashes, includeBackticks, false) + : RenderProperty(ni, nestedIndent, includeDashes, includeBackticks); + }).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes, includeBackticks)); + return String.Join(Environment.NewLine, nested); + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsProxyTypes.cs new file mode 100644 index 000000000000..be6b291c35f2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -0,0 +1,514 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Linq; +using System.Management.Automation; +using System.Reflection; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + internal class ProfileGroup + { + public string ProfileName { get; } + public Variant[] Variants { get; } + public string ProfileFolder { get; } + + public ProfileGroup(Variant[] variants, string profileName = NoProfiles) + { + ProfileName = profileName; + Variants = variants; + ProfileFolder = ProfileName != NoProfiles ? ProfileName : String.Empty; + } + } + + internal class VariantGroup + { + public string ModuleName { get; } + + public string RootModuleName {get => @"";} + public string CmdletName { get; } + public string CmdletVerb { get; } + public string CmdletNoun { get; } + public string ProfileName { get; } + public Variant[] Variants { get; } + public ParameterGroup[] ParameterGroups { get; } + public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } + + public string[] Aliases { get; } + public PSTypeName[] OutputTypes { get; } + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + public string DefaultParameterSetName { get; } + public bool HasMultipleVariants { get; } + public PsHelpInfo HelpInfo { get; } + public bool IsGenerated { get; } + public bool IsInternal { get; } + + public string OutputFolder { get; } + public string FileName { get; } + public string FilePath { get; } + + public CommentInfo CommentInfo { get; } + + public VariantGroup(string moduleName, string cmdletName, Variant[] variants, string outputFolder, string profileName = NoProfiles, bool isTest = false, bool isInternal = false) + { + ModuleName = moduleName; + CmdletName = cmdletName; + var cmdletNameParts = CmdletName.Split('-'); + CmdletVerb = cmdletNameParts.First(); + CmdletNoun = cmdletNameParts.Last(); + ProfileName = profileName; + Variants = variants; + ParameterGroups = Variants.ToParameterGroups().OrderBy(pg => pg.OrderCategory).ThenByDescending(pg => pg.IsMandatory).ToArray(); + var aliasDuplicates = ParameterGroups.SelectMany(pg => pg.Aliases) + //https://stackoverflow.com/a/18547390/294804 + .GroupBy(a => a).Where(g => g.Count() > 1).Select(g => g.Key).ToArray(); + if (aliasDuplicates.Any()) + { + throw new ParsingMetadataException($"The alias(es) [{String.Join(", ", aliasDuplicates)}] are defined on multiple parameters for cmdlet '{CmdletName}', which is not supported."); + } + ComplexInterfaceInfos = ParameterGroups.Where(pg => !pg.DontShow && pg.IsComplexInterface).OrderBy(pg => pg.ParameterName).Select(pg => pg.ComplexInterfaceInfo).ToArray(); + + Aliases = Variants.SelectMany(v => v.Attributes).ToAliasNames().ToArray(); + OutputTypes = Variants.SelectMany(v => v.Info.OutputType).Where(ot => ot.Type != null).GroupBy(ot => ot.Type).Select(otg => otg.First()).ToArray(); + SupportsShouldProcess = Variants.Any(v => v.SupportsShouldProcess); + SupportsPaging = Variants.Any(v => v.SupportsPaging); + DefaultParameterSetName = DetermineDefaultParameterSetName(); + HasMultipleVariants = Variants.Length > 1; + HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); + IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); + IsInternal = isInternal; + + OutputFolder = outputFolder; + FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; + FilePath = Path.Combine(OutputFolder, FileName); + + CommentInfo = new CommentInfo(this); + } + + private string DetermineDefaultParameterSetName() + { + var defaultParameterSet = Variants + .Select(v => v.Metadata.DefaultParameterSetName) + .LastOrDefault(dpsn => dpsn.IsValidDefaultParameterSetName()); + + if (String.IsNullOrEmpty(defaultParameterSet)) + { + var variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); + var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); + defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; + } + + return defaultParameterSet; + } + } + + internal class Variant + { + public string CmdletName { get; } + public string VariantName { get; } + public CommandInfo Info { get; } + public CommandMetadata Metadata { get; } + public PsHelpInfo HelpInfo { get; } + public bool HasParameterSets { get; } + public bool IsFunction { get; } + public string PrivateModuleName { get; } + public string PrivateCmdletName { get; } + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + + public Attribute[] Attributes { get; } + public Parameter[] Parameters { get; } + public Parameter[] CmdletOnlyParameters { get; } + public bool IsInternal { get; } + public bool IsDoNotExport { get; } + public string[] Profiles { get; } + + public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) + { + CmdletName = cmdletName; + VariantName = variantName; + Info = info; + HelpInfo = helpInfo ?? new PsHelpInfo(); + Metadata = metadata; + HasParameterSets = hasParameterSets; + IsFunction = Info.CommandType == CommandTypes.Function; + PrivateModuleName = Info.Source; + PrivateCmdletName = Metadata.Name; + SupportsShouldProcess = Metadata.SupportsShouldProcess; + SupportsPaging = Metadata.SupportsPaging; + + Attributes = this.ToAttributes(); + Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); + IsInternal = Attributes.OfType().Any(); + IsDoNotExport = Attributes.OfType().Any(); + CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); + Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); + } + } + + internal class ParameterGroup + { + public string ParameterName { get; } + public Parameter[] Parameters { get; } + + public string[] VariantNames { get; } + public string[] AllVariantNames { get; } + public bool HasAllVariants { get; } + public Type ParameterType { get; } + public string Description { get; } + + public string[] Aliases { get; } + public bool HasValidateNotNull { get; } + public bool HasAllowEmptyArray { get; } + public CompleterInfo CompleterInfo { get; } + public DefaultInfo DefaultInfo { get; } + public bool HasDefaultInfo { get; } + public ParameterCategory OrderCategory { get; } + public bool DontShow { get; } + public bool IsMandatory { get; } + public bool SupportsWildcards { get; } + public bool IsComplexInterface { get; } + public ComplexInterfaceInfo ComplexInterfaceInfo { get; } + public InfoAttribute InfoAttribute { get; } + + public int? FirstPosition { get; } + public bool ValueFromPipeline { get; } + public bool ValueFromPipelineByPropertyName { get; } + public bool IsInputType { get; } + + public ParameterGroup(string parameterName, Parameter[] parameters, string[] allVariantNames) + { + ParameterName = parameterName; + Parameters = parameters; + + VariantNames = Parameters.Select(p => p.VariantName).ToArray(); + AllVariantNames = allVariantNames; + HasAllVariants = VariantNames.Any(vn => vn == AllParameterSets) || !AllVariantNames.Except(VariantNames).Any(); + var types = Parameters.Select(p => p.ParameterType).Distinct().ToArray(); + if (types.Length > 1) + { + throw new ParsingMetadataException($"The parameter '{ParameterName}' has multiple parameter types [{String.Join(", ", types.Select(t => t.Name))}] defined, which is not supported."); + } + ParameterType = types.First(); + Description = Parameters.Select(p => p.Description).FirstOrDefault(d => !String.IsNullOrEmpty(d)).EmptyIfNull(); + + Aliases = Parameters.SelectMany(p => p.Attributes).ToAliasNames().ToArray(); + HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); + HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); + CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); + DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) + ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); + HasDefaultInfo = DefaultInfo != null && !String.IsNullOrEmpty(DefaultInfo.Script); + // When DefaultInfo is present, force all parameters from this group to be optional. + if (HasDefaultInfo) + { + foreach (var parameter in Parameters) + { + parameter.IsMandatory = false; + } + } + OrderCategory = Parameters.Select(p => p.OrderCategory).Distinct().DefaultIfEmpty(ParameterCategory.Body).Min(); + DontShow = Parameters.All(p => p.DontShow); + IsMandatory = HasAllVariants && Parameters.Any(p => p.IsMandatory); + SupportsWildcards = Parameters.Any(p => p.SupportsWildcards); + IsComplexInterface = Parameters.Any(p => p.IsComplexInterface); + ComplexInterfaceInfo = Parameters.Where(p => p.IsComplexInterface).Select(p => p.ComplexInterfaceInfo).FirstOrDefault(); + InfoAttribute = Parameters.Select(p => p.InfoAttribute).First(); + + FirstPosition = Parameters.Select(p => p.Position).FirstOrDefault(p => p != null); + ValueFromPipeline = Parameters.Any(p => p.ValueFromPipeline); + ValueFromPipelineByPropertyName = Parameters.Any(p => p.ValueFromPipelineByPropertyName); + IsInputType = ValueFromPipeline || ValueFromPipelineByPropertyName; + } + } + + internal class Parameter + { + public string VariantName { get; } + public string ParameterName { get; } + public ParameterMetadata Metadata { get; } + public PsParameterHelpInfo HelpInfo { get; } + public Type ParameterType { get; } + + public Attribute[] Attributes { get; } + public ParameterCategory[] Categories { get; } + public ParameterCategory OrderCategory { get; } + public PSDefaultValueAttribute DefaultValueAttribute { get; } + public DefaultInfoAttribute DefaultInfoAttribute { get; } + public ParameterAttribute ParameterAttribute { get; } + public bool SupportsWildcards { get; } + public CompleterInfoAttribute CompleterInfoAttribute { get; } + public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + + public bool ValueFromPipeline { get; } + public bool ValueFromPipelineByPropertyName { get; } + public int? Position { get; } + public bool DontShow { get; } + public bool IsMandatory { get; set; } + + public InfoAttribute InfoAttribute { get; } + public ComplexInterfaceInfo ComplexInterfaceInfo { get; } + public bool IsComplexInterface { get; } + public string Description { get; } + + public Parameter(string variantName, string parameterName, ParameterMetadata metadata, PsParameterHelpInfo helpInfo = null) + { + VariantName = variantName; + ParameterName = parameterName; + Metadata = metadata; + HelpInfo = helpInfo ?? new PsParameterHelpInfo(); + + Attributes = Metadata.Attributes.ToArray(); + ParameterType = Attributes.OfType().FirstOrDefault()?.Type ?? Metadata.ParameterType; + Categories = Attributes.OfType().SelectMany(ca => ca.Categories).Distinct().ToArray(); + OrderCategory = Categories.DefaultIfEmpty(ParameterCategory.Body).Min(); + DefaultValueAttribute = Attributes.OfType().FirstOrDefault(); + DefaultInfoAttribute = Attributes.OfType().FirstOrDefault(); + ParameterAttribute = Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == VariantName || pa.ParameterSetName == AllParameterSets); + if (ParameterAttribute == null) + { + throw new ParsingMetadataException($"The variant '{VariantName}' has multiple parameter sets defined, which is not supported."); + } + SupportsWildcards = Attributes.OfType().Any(); + CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + + ValueFromPipeline = ParameterAttribute.ValueFromPipeline; + ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; + Position = ParameterAttribute.Position == Int32.MinValue ? (int?)null : ParameterAttribute.Position; + DontShow = ParameterAttribute.DontShow; + IsMandatory = ParameterAttribute.Mandatory; + + var complexParameterName = ParameterName.ToUpperInvariant(); + var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; + // Remove the complex type message as it will be reinserted if this is a complex type + description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + // Make an InfoAttribute for processing only if one isn't provided + InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; + // Set the description if the InfoAttribute does not have one since they are exported without a description + InfoAttribute.Description = String.IsNullOrEmpty(InfoAttribute.Description) ? description : InfoAttribute.Description; + ComplexInterfaceInfo = InfoAttribute.ToComplexInterfaceInfo(complexParameterName, ParameterType, true); + IsComplexInterface = ComplexInterfaceInfo.IsComplexInterface; + Description = $"{description}{(IsComplexInterface ? complexMessage : String.Empty)}"; + } + } + + internal class ComplexInterfaceInfo + { + public InfoAttribute InfoAttribute { get; } + + public string Name { get; } + public Type Type { get; } + public bool Required { get; } + public bool ReadOnly { get; } + public string Description { get; } + + public ComplexInterfaceInfo[] NestedInfos { get; } + public bool IsComplexInterface { get; } + + public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, bool? required, List seenTypes) + { + Name = name; + Type = type; + InfoAttribute = infoAttribute; + + Required = required ?? InfoAttribute.Required; + ReadOnly = InfoAttribute.ReadOnly; + Description = InfoAttribute.Description.ToPsSingleLine(); + + var unwrappedType = Type.Unwrap(); + var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; + (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + unwrappedType.GetInterfaces() + .Concat(InfoAttribute.PossibleTypes) + .SelectMany(pt => pt.GetProperties() + .SelectMany(pi => pi.GetCustomAttributes(true).OfType() + .Select(ia => ia.ToComplexInterfaceInfo(pi.Name, pi.PropertyType, seenTypes: seenTypes)))) + .Where(cii => !cii.ReadOnly).OrderByDescending(cii => cii.Required).ToArray(); + // https://stackoverflow.com/a/503359/294804 + var associativeArrayInnerType = Type.GetInterfaces() + .FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IAssociativeArray<>)) + ?.GetTypeInfo().GetGenericArguments().First(); + if (!hasBeenSeen && associativeArrayInnerType != null) + { + var anyInfo = new InfoAttribute { Description = "This indicates any property can be added to this object." }; + NestedInfos = NestedInfos.Prepend(anyInfo.ToComplexInterfaceInfo("(Any)", associativeArrayInnerType)).ToArray(); + } + IsComplexInterface = NestedInfos.Any(); + } + } + + internal class CommentInfo + { + public string Description { get; } + public string Synopsis { get; } + + public string[] Examples { get; } + public string[] Inputs { get; } + public string[] Outputs { get; } + + public string OnlineVersion { get; } + public string[] RelatedLinks { get; } + + private const string HelpLinkPrefix = @"https://learn.microsoft.com/powershell/module/"; + + public CommentInfo(VariantGroup variantGroup) + { + var helpInfo = variantGroup.HelpInfo; + Description = variantGroup.Variants.SelectMany(v => v.Attributes).OfType().FirstOrDefault()?.Description.NullIfEmpty() + ?? helpInfo.Description.EmptyIfNull(); + // If there is no Synopsis, PowerShell may put in the Syntax string as the Synopsis. This seems unintended, so we remove the Synopsis in this situation. + var synopsis = helpInfo.Synopsis.EmptyIfNull().Trim().StartsWith(variantGroup.CmdletName) ? String.Empty : helpInfo.Synopsis; + Synopsis = synopsis.NullIfEmpty() ?? Description; + + Examples = helpInfo.Examples.Select(rl => rl.Code).ToArray(); + + Inputs = (variantGroup.ParameterGroups.Where(pg => pg.IsInputType).Select(pg => pg.ParameterType.FullName).ToArray().NullIfEmpty() ?? + helpInfo.InputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(it => it.Name).ToArray()) + .Where(i => i != "None").Distinct().OrderBy(i => i).ToArray(); + Outputs = (variantGroup.OutputTypes.Select(ot => ot.Type.FullName).ToArray().NullIfEmpty() ?? + helpInfo.OutputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(ot => ot.Name).ToArray()) + .Where(o => o != "None").Distinct().OrderBy(o => o).ToArray(); + + // Use root module name in the help link + var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); + OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; + RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); + } + } + + internal class CompleterInfo + { + public string Name { get; } + public string Description { get; } + public string Script { get; } + public Type Type { get; } + public bool IsTypeCompleter { get; } + + public CompleterInfo(CompleterInfoAttribute infoAttribute) + { + Name = infoAttribute.Name; + Description = infoAttribute.Description; + Script = infoAttribute.Script; + } + + public CompleterInfo(ArgumentCompleterAttribute completerAttribute) + { + Script = completerAttribute.ScriptBlock?.ToString(); + if (completerAttribute.Type != null) + { + Type = completerAttribute.Type; + IsTypeCompleter = true; + } + } + } + + internal class DefaultInfo + { + public string Name { get; } + public string Description { get; } + public string Script { get; } + public ParameterGroup ParameterGroup { get; } + + public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) + { + Name = infoAttribute.Name; + Description = infoAttribute.Description; + Script = infoAttribute.Script; + ParameterGroup = parameterGroup; + } + + public DefaultInfo(PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) + { + Description = defaultValueAttribute.Help; + ParameterGroup = parameterGroup; + if (defaultValueAttribute.Value != null) + { + Script = defaultValueAttribute.Value.ToString(); + } + } + } + + internal static class PsProxyTypeExtensions + { + public const string NoProfiles = "__NoProfiles"; + + public static bool IsValidDefaultParameterSetName(this string parameterSetName) => + !String.IsNullOrEmpty(parameterSetName) && parameterSetName != AllParameterSets; + + public static Variant[] ToVariants(this CommandInfo info, PsHelpInfo helpInfo) + { + var metadata = new CommandMetadata(info); + var privateCmdletName = metadata.Name.Split('!').First(); + var parts = privateCmdletName.Split('_'); + return parts.Length > 1 + ? new[] { new Variant(parts[0], parts[1], info, metadata, helpInfo: helpInfo) } + // Process multiple parameter sets, so we declare a variant per parameter set. + : info.ParameterSets.Select(ps => new Variant(privateCmdletName, ps.Name, info, metadata, true, helpInfo)).ToArray(); + } + + public static Variant[] ToVariants(this CmdletAndHelpInfo info) => info.CommandInfo.ToVariants(info.HelpInfo); + + public static Variant[] ToVariants(this CommandInfo info, PSObject helpInfo = null) => info.ToVariants(helpInfo?.ToPsHelpInfo()); + + public static Parameter[] ToParameters(this Variant variant) + { + var parameters = variant.Metadata.Parameters.AsEnumerable(); + var parameterHelp = variant.HelpInfo.Parameters.AsEnumerable(); + + if (variant.HasParameterSets) + { + parameters = parameters.Where(p => p.Value.ParameterSets.Keys.Any(k => k == variant.VariantName || k == AllParameterSets)); + parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); + } + var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); + if (variant.SupportsPaging) { + // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters + variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; + variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; + result = result.Append(new Parameter(variant.VariantName, "First", variant.Info.Parameters["First"], parameterHelp.FirstOrDefault(ph => ph.Name == "First"))); + result = result.Append(new Parameter(variant.VariantName, "Skip", variant.Info.Parameters["Skip"], parameterHelp.FirstOrDefault(ph => ph.Name == "Skip"))); + } + return result.ToArray(); + } + + public static Attribute[] ToAttributes(this Variant variant) => variant.IsFunction + ? ((FunctionInfo)variant.Info).ScriptBlock.Attributes.ToArray() + : variant.Metadata.CommandType.GetCustomAttributes(false).Cast().ToArray(); + + public static IEnumerable ToParameterGroups(this Variant[] variants) + { + var allVariantNames = variants.Select(vg => vg.VariantName).ToArray(); + return variants + .SelectMany(v => v.Parameters) + .GroupBy(p => p.ParameterName, StringComparer.InvariantCultureIgnoreCase) + .Select(pg => new ParameterGroup(pg.Key, pg.Select(p => p).ToArray(), allVariantNames)); + } + + public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute infoAttribute, string name, Type type, bool? required = null, List seenTypes = null) + => new ComplexInterfaceInfo(name, type, infoAttribute, required, seenTypes); + + public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); + public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); + + public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); + public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/PsAttributes.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/PsAttributes.cs new file mode 100644 index 000000000000..186aacf05036 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/PsAttributes.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. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup +{ + [AttributeUsage(AttributeTargets.Class)] + public class DescriptionAttribute : Attribute + { + public string Description { get; } + + public DescriptionAttribute(string description) + { + Description = description; + } + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class DoNotExportAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class InternalExportAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class GeneratedAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class DoNotFormatAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class ProfileAttribute : Attribute + { + public string[] Profiles { get; } + + public ProfileAttribute(params string[] profiles) + { + Profiles = profiles; + } + } + + [AttributeUsage(AttributeTargets.Class)] + public class HttpPathAttribute : Attribute + { + public string Path { get; set; } + public string ApiVersion { get; set; } + } + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class CategoryAttribute : Attribute + { + public ParameterCategory[] Categories { get; } + + public CategoryAttribute(params ParameterCategory[] categories) + { + Categories = categories; + } + } + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class ExportAsAttribute : Attribute + { + public Type Type { get; set; } + + public ExportAsAttribute(Type type) + { + Type = type; + } + } + + public enum ParameterCategory + { + // Note: Order is significant + Uri = 0, + Path, + Query, + Header, + Cookie, + Body, + Azure, + Runtime + } + + [AttributeUsage(AttributeTargets.Property)] + public class OriginAttribute : Attribute + { + public PropertyOrigin Origin { get; } + + public OriginAttribute(PropertyOrigin origin) + { + Origin = origin; + } + } + + public enum PropertyOrigin + { + // Note: Order is significant + Inherited = 0, + Owned, + Inlined + } + + [AttributeUsage(AttributeTargets.Property)] + public class FormatTableAttribute : Attribute + { + public int Index { get; set; } = -1; + public bool HasIndex => Index != -1; + public string Label { get; set; } + public int Width { get; set; } = -1; + public bool HasWidth => Width != -1; + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/PsExtensions.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/PsExtensions.cs new file mode 100644 index 000000000000..a1d7a076badd --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/PsExtensions.cs @@ -0,0 +1,169 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Linq; +using System.Management.Automation; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + internal static class PsExtensions + { + // https://stackoverflow.com/a/863944/294804 + // https://stackoverflow.com/a/4452598/294804 + // https://stackoverflow.com/a/28701974/294804 + // Note: This will unwrap nested collections, but we don't generate nested collections. + public static Type Unwrap(this Type type) + { + if (type.IsArray) + { + return type.GetElementType().Unwrap(); + } + + var typeInfo = type.GetTypeInfo(); + if (typeInfo.IsGenericType + && (typeInfo.GetGenericTypeDefinition() == typeof(Nullable<>) || typeof(IEnumerable<>).IsAssignableFrom(type))) + { + return typeInfo.GetGenericArguments().First().Unwrap(); + } + + return type; + } + + // https://stackoverflow.com/a/863944/294804 + private static bool IsSimple(this Type type) + { + var typeInfo = type.GetTypeInfo(); + return typeInfo.IsPrimitive + || typeInfo.IsEnum + || type == typeof(string) + || type == typeof(decimal); + } + + // https://stackoverflow.com/a/32025393/294804 + private static bool HasImplicitConversion(this Type baseType, Type targetType) => + baseType.GetMethods(BindingFlags.Public | BindingFlags.Static) + .Where(mi => mi.Name == "op_Implicit" && mi.ReturnType == targetType) + .Any(mi => mi.GetParameters().FirstOrDefault()?.ParameterType == baseType); + + public static bool IsPsSimple(this Type type) + { + var unwrappedType = type.Unwrap(); + return unwrappedType.IsSimple() + || unwrappedType == typeof(SwitchParameter) + || unwrappedType == typeof(Hashtable) + || unwrappedType == typeof(PSCredential) + || unwrappedType == typeof(ScriptBlock) + || unwrappedType == typeof(DateTime) + || unwrappedType == typeof(Uri) + || unwrappedType.HasImplicitConversion(typeof(string)); + } + + public static string ToPsList(this IEnumerable items) => String.Join(", ", items.Select(i => $"'{i}'")); + + public static IEnumerable ToAliasNames(this IEnumerable attributes) => attributes.OfType().SelectMany(aa => aa.AliasNames).Distinct(); + + public static bool IsArrayAndElementTypeIsT(this object item) + { + var itemType = item.GetType(); + var tType = typeof(T); + return itemType.IsArray && !tType.IsArray && tType.IsAssignableFrom(itemType.GetElementType()); + } + + public static bool IsTArrayAndElementTypeIsItem(this object item) + { + var itemType = item.GetType(); + var tType = typeof(T); + return !itemType.IsArray && tType.IsArray && (tType.GetElementType()?.IsAssignableFrom(itemType) ?? false); + } + + public static bool IsTypeOrArrayOfType(this object item) => item is T || item.IsArrayAndElementTypeIsT() || item.IsTArrayAndElementTypeIsItem(); + + public static T NormalizeArrayType(this object item) + { + if (item is T result) + { + return result; + } + + if (item.IsArrayAndElementTypeIsT()) + { + var array = (T[])Convert.ChangeType(item, typeof(T[])); + return array.FirstOrDefault(); + } + + if (item.IsTArrayAndElementTypeIsItem()) + { + var tType = typeof(T); + var array = Array.CreateInstance(tType.GetElementType(), 1); + array.SetValue(item, 0); + return (T)Convert.ChangeType(array, tType); + } + + return default(T); + } + + public static T GetNestedProperty(this PSObject psObject, params string[] names) => psObject.Properties.GetNestedProperty(names); + + public static T GetNestedProperty(this PSMemberInfoCollection properties, params string[] names) + { + var lastName = names.Last(); + var nestedProperties = names.Take(names.Length - 1).Aggregate(properties, (p, n) => p?.GetProperty(n)?.Properties); + return nestedProperties != null ? nestedProperties.GetProperty(lastName) : default(T); + } + + public static T GetProperty(this PSObject psObject, string name) => psObject.Properties.GetProperty(name); + + public static T GetProperty(this PSMemberInfoCollection properties, string name) + { + switch (properties[name]?.Value) + { + case PSObject psObject when psObject.BaseObject is PSCustomObject && psObject.ImmediateBaseObject.IsTypeOrArrayOfType(): + return psObject.ImmediateBaseObject.NormalizeArrayType(); + case PSObject psObject when psObject.BaseObject.IsTypeOrArrayOfType(): + return psObject.BaseObject.NormalizeArrayType(); + case object value when value.IsTypeOrArrayOfType(): + return value.NormalizeArrayType(); + default: + return default(T); + } + } + + public static IEnumerable RunScript(this PSCmdlet cmdlet, string script) + => PsHelpers.RunScript(cmdlet.InvokeCommand, script); + + public static void RunScript(this PSCmdlet cmdlet, string script) + => cmdlet.RunScript(script); + + public static IEnumerable RunScript(this EngineIntrinsics engineIntrinsics, string script) + => PsHelpers.RunScript(engineIntrinsics.InvokeCommand, script); + + public static void RunScript(this EngineIntrinsics engineIntrinsics, string script) + => engineIntrinsics.RunScript(script); + + public static IEnumerable RunScript(this PSCmdlet cmdlet, ScriptBlock block) + => PsHelpers.RunScript(cmdlet.InvokeCommand, block.ToString()); + + public static void RunScript(this PSCmdlet cmdlet, ScriptBlock block) + => cmdlet.RunScript(block.ToString()); + + public static IEnumerable RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block) + => PsHelpers.RunScript(engineIntrinsics.InvokeCommand, block.ToString()); + + public static void RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block) + => engineIntrinsics.RunScript(block.ToString()); + + /// + /// Returns if a parameter should be hidden by checking for . + /// + /// A PowerShell parameter. + public static bool IsHidden(this Parameter parameter) + { + return parameter.Attributes.Any(attr => attr is DoNotExportAttribute); + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/PsHelpers.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/PsHelpers.cs new file mode 100644 index 000000000000..d55f1ec0787f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/PsHelpers.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using Pwsh = System.Management.Automation.PowerShell; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + internal static class PsHelpers + { + public static IEnumerable RunScript(string script) + => Pwsh.Create().AddScript(script).Invoke(); + + public static void RunScript(string script) + => RunScript(script); + + public static IEnumerable RunScript(CommandInvocationIntrinsics cii, string script) + => cii.InvokeScript(script).Select(o => o?.BaseObject).Where(o => o != null).OfType(); + + public static void RunScript(CommandInvocationIntrinsics cii, string script) + => RunScript(cii, script); + + public static IEnumerable GetModuleCmdlets(PSCmdlet cmdlet, params string[] modulePaths) + { + var getCmdletsCommand = String.Join(" + ", modulePaths.Select(mp => $"(Get-Command -Module (Import-Module '{mp}' -PassThru))")); + return (cmdlet?.RunScript(getCmdletsCommand) ?? RunScript(getCmdletsCommand)) + .Where(ci => ci.CommandType != CommandTypes.Alias); + } + + public static IEnumerable GetModuleCmdlets(params string[] modulePaths) + => GetModuleCmdlets(null, modulePaths); + + public static IEnumerable GetScriptCmdlets(PSCmdlet cmdlet, string scriptFolder) + { + // https://stackoverflow.com/a/40969712/294804 + var wrappedFolder = scriptFolder.Contains("'") ? $@"""{scriptFolder}""" : $@"'{scriptFolder}'"; + var getCmdletsCommand = $@" +$currentFunctions = Get-ChildItem function: +Get-ChildItem -Path {wrappedFolder} -Recurse -Include '*.ps1' -File | ForEach-Object {{ . $_.FullName }} +Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }} +"; + return cmdlet?.RunScript(getCmdletsCommand) ?? RunScript(getCmdletsCommand); + } + + public static IEnumerable GetScriptCmdlets(string scriptFolder) + => GetScriptCmdlets(null, scriptFolder); + + public static IEnumerable GetScriptHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) + { + var importModules = String.Join(Environment.NewLine, modulePaths.Select(mp => $"Import-Module '{mp}'")); + var getHelpCommand = $@" +$currentFunctions = Get-ChildItem function: +{importModules} +Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }} | ForEach-Object {{ Get-Help -Name $_.Name -Full }} +"; + return cmdlet?.RunScript(getHelpCommand) ?? RunScript(getHelpCommand); + } + + public static IEnumerable GetScriptHelpInfo(params string[] modulePaths) + => GetScriptHelpInfo(null, modulePaths); + + public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) + { + var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => + $@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})" + )); + return (cmdlet?.RunScript(getCmdletAndHelp) ?? RunScript(getCmdletAndHelp)) + .Select(h => new CmdletAndHelpInfo { CommandInfo = (h["CommandInfo"] as PSObject)?.BaseObject as CommandInfo, HelpInfo = h["HelpInfo"] as PSObject }); + } + + public static IEnumerable GetModuleCmdletsAndHelpInfo(params string[] modulePaths) + => GetModuleCmdletsAndHelpInfo(null, modulePaths); + + public static CmdletAndHelpInfo ToCmdletAndHelpInfo(this CommandInfo commandInfo, PSObject helpInfo) => new CmdletAndHelpInfo { CommandInfo = commandInfo, HelpInfo = helpInfo }; + + public const string Psd1Indent = " "; + public const string GuidStart = Psd1Indent + "GUID"; + + public static Guid ReadGuidFromPsd1(string psd1Path) + { + var guid = Guid.NewGuid(); + if (File.Exists(psd1Path)) + { + var currentGuid = File.ReadAllLines(psd1Path) + .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .LastOrDefault()?.Replace("'", String.Empty); + guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; + } + + return guid; + } + } + + internal class CmdletAndHelpInfo + { + public CommandInfo CommandInfo { get; set; } + public PSObject HelpInfo { get; set; } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/StringExtensions.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/StringExtensions.cs new file mode 100644 index 000000000000..7898566c2e39 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/StringExtensions.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; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + internal static class StringExtensions + { + public static string NullIfEmpty(this string text) => String.IsNullOrEmpty(text) ? null : text; + public static string NullIfWhiteSpace(this string text) => String.IsNullOrWhiteSpace(text) ? null : text; + public static string EmptyIfNull(this string text) => text ?? String.Empty; + + public static bool? ToNullableBool(this string text) => String.IsNullOrEmpty(text) ? (bool?)null : Convert.ToBoolean(text.ToLowerInvariant()); + + public static string ToUpperFirstCharacter(this string text) => String.IsNullOrEmpty(text) ? text : $"{text[0].ToString().ToUpperInvariant()}{text.Remove(0, 1)}"; + + public static string ReplaceNewLines(this string value, string replacer = " ", string[] newLineSymbols = null) + => (newLineSymbols ?? new []{ "\r\n", "\n" }).Aggregate(value.EmptyIfNull(), (current, symbol) => current.Replace(symbol, replacer)); + public static string NormalizeNewLines(this string value) => value.ReplaceNewLines("\u00A0").Replace("\u00A0", Environment.NewLine); + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/XmlExtensions.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/XmlExtensions.cs new file mode 100644 index 000000000000..ef99f5d9eb33 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/BuildTime/XmlExtensions.cs @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.IO; +using System.Xml; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + internal static class XmlExtensions + { + public static string ToXmlString(this T inputObject, bool excludeDeclaration = false) + { + var serializer = new XmlSerializer(typeof(T)); + //https://stackoverflow.com/a/760290/294804 + //https://stackoverflow.com/a/3732234/294804 + var namespaces = new XmlSerializerNamespaces(new[] { XmlQualifiedName.Empty }); + var xmlSettings = new XmlWriterSettings { OmitXmlDeclaration = excludeDeclaration, Indent = true }; + using (var stringWriter = new StringWriter()) + using (var xmlWriter = XmlWriter.Create(stringWriter, xmlSettings)) + { + serializer.Serialize(xmlWriter, inputObject, namespaces); + return stringWriter.ToString(); + } + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/CmdInfoHandler.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/CmdInfoHandler.cs new file mode 100644 index 000000000000..02b31b3a58ff --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/ConversionException.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/ConversionException.cs new file mode 100644 index 000000000000..601dfc68aa85 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/IJsonConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/IJsonConverter.cs new file mode 100644 index 000000000000..88370cf81802 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/BinaryConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/BinaryConverter.cs new file mode 100644 index 000000000000..85b0bfbf80f2 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/BooleanConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/BooleanConverter.cs new file mode 100644 index 000000000000..3f032481a9aa --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/DateTimeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/DateTimeConverter.cs new file mode 100644 index 000000000000..1ab45d89dcb8 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs new file mode 100644 index 000000000000..032472c7f94b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/DecimalConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/DecimalConverter.cs new file mode 100644 index 000000000000..558bdb42d287 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/DoubleConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/DoubleConverter.cs new file mode 100644 index 000000000000..32f1bcb4a1b5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/EnumConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/EnumConverter.cs new file mode 100644 index 000000000000..c9d9a8878b39 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/GuidConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/GuidConverter.cs new file mode 100644 index 000000000000..1e47b9452374 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/HashSet'1Converter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/HashSet'1Converter.cs new file mode 100644 index 000000000000..c3f6e32c2eca --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/Int16Converter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/Int16Converter.cs new file mode 100644 index 000000000000..9a139aa93872 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/Int32Converter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/Int32Converter.cs new file mode 100644 index 000000000000..c4889d343f16 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/Int64Converter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/Int64Converter.cs new file mode 100644 index 000000000000..23558742dc15 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/JsonArrayConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/JsonArrayConverter.cs new file mode 100644 index 000000000000..e05c0daf2823 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/JsonObjectConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/JsonObjectConverter.cs new file mode 100644 index 000000000000..7dd9c0364c1f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/SingleConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/SingleConverter.cs new file mode 100644 index 000000000000..905bababf0d0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/StringConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/StringConverter.cs new file mode 100644 index 000000000000..f135dd36ed65 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/TimeSpanConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/TimeSpanConverter.cs new file mode 100644 index 000000000000..a306d14ebc34 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/UInt16Converter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/UInt16Converter.cs new file mode 100644 index 000000000000..3f9ca1ff7851 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/UInt32Converter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/UInt32Converter.cs new file mode 100644 index 000000000000..eb534d9072ff --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/UInt64Converter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/UInt64Converter.cs new file mode 100644 index 000000000000..51e887291522 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/Instances/UriConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/Instances/UriConverter.cs new file mode 100644 index 000000000000..5f7070b01625 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/JsonConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/JsonConverter.cs new file mode 100644 index 000000000000..5c4e0f41d6b5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/JsonConverterAttribute.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/JsonConverterAttribute.cs new file mode 100644 index 000000000000..c355ba95e87d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/JsonConverterFactory.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/JsonConverterFactory.cs new file mode 100644 index 000000000000..10c850fdfae0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Conversions/StringLikeConverter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Conversions/StringLikeConverter.cs new file mode 100644 index 000000000000..bf01338ebc67 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Customizations/IJsonSerializable.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Customizations/IJsonSerializable.cs new file mode 100644 index 000000000000..7735a7abf027 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Customizations/JsonArray.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Customizations/JsonArray.cs new file mode 100644 index 000000000000..659ef466b80e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Customizations/JsonBoolean.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Customizations/JsonBoolean.cs new file mode 100644 index 000000000000..2b41e3ac0484 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Customizations/JsonNode.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Customizations/JsonNode.cs new file mode 100644 index 000000000000..39d105818e66 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Customizations/JsonNumber.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Customizations/JsonNumber.cs new file mode 100644 index 000000000000..583ee4d3a3ed --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Customizations/JsonObject.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Customizations/JsonObject.cs new file mode 100644 index 000000000000..30185d16fb0b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Customizations/JsonString.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Customizations/JsonString.cs new file mode 100644 index 000000000000..7bd61b812c2f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Customizations/XNodeArray.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Customizations/XNodeArray.cs new file mode 100644 index 000000000000..a92c50478052 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Debugging.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Debugging.cs new file mode 100644 index 000000000000..0af053a51374 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Debugging.cs @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + internal static class AttachDebugger + { + internal static void Break() + { + while (!System.Diagnostics.Debugger.IsAttached) + { + System.Console.Error.WriteLine($"Waiting for debugger to attach to process {System.Diagnostics.Process.GetCurrentProcess().Id}"); + for (int i = 0; i < 50; i++) + { + if (System.Diagnostics.Debugger.IsAttached) + { + break; + } + System.Threading.Thread.Sleep(100); + System.Console.Error.Write("."); + } + System.Console.Error.WriteLine(); + } + System.Diagnostics.Debugger.Break(); + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/DictionaryExtensions.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/DictionaryExtensions.cs new file mode 100644 index 000000000000..8de11eda0ed7 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/DictionaryExtensions.cs @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * 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 DictionaryExtensions + { + internal static void HashTableToDictionary(System.Collections.Hashtable hashtable, System.Collections.Generic.IDictionary dictionary) + { + if (null == hashtable) + { + return; + } + foreach (var each in hashtable.Keys) + { + var key = each.ToString(); + var value = hashtable[key]; + if (null != value) + { + try + { + dictionary[key] = (V)value; + } + catch + { + // Values getting dropped; not compatible with target dictionary. Not sure what to do here. + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/EventData.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/EventData.cs new file mode 100644 index 000000000000..8263d93268fc --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/EventDataExtensions.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/EventDataExtensions.cs new file mode 100644 index 000000000000..3c0239e0b076 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/EventDataExtensions.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. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + using System; + + /// + /// PowerShell-specific data on top of the llc# EventData + /// + /// + /// In PowerShell, we add on the EventDataConverter to support sending events between modules. + /// Obviously, this code would need to be duplcated on both modules. + /// This is preferable to sharing a common library, as versioning makes that problematic. + /// + [System.ComponentModel.TypeConverter(typeof(EventDataConverter))] + public partial class EventData : EventArgs + { + } + + /// + /// A PowerShell PSTypeConverter to adapt an EventData object that has been passed. + /// Usually used between modules. + /// + public class EventDataConverter : System.Management.Automation.PSTypeConverter + { + public override bool CanConvertTo(object sourceValue, Type destinationType) => false; + public override object ConvertTo(object sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase) => null; + public override bool CanConvertFrom(dynamic sourceValue, Type destinationType) => destinationType == typeof(EventData) && CanConvertFrom(sourceValue); + public override object ConvertFrom(dynamic sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Verifies that a given object has the required members to convert it to the target type (EventData) + /// + /// Uses a dynamic type so that it is able to use the simplest code without excessive checking. + /// + /// The instance to verify + /// True, if the object has all the required parameters. + public static bool CanConvertFrom(dynamic sourceValue) + { + try + { + // check if this has *required* parameters... + sourceValue?.Id?.GetType(); + sourceValue?.Message?.GetType(); + sourceValue?.Cancel?.GetType(); + + // remaining parameters are not *required*, + // and if they have values, it will copy them at conversion time. + } + catch + { + // if anything throws an exception (because it's null, or doesn't have that member) + return false; + } + return true; + } + + /// + /// Returns result of the delegate as the expected type, or default(T) + /// + /// This isolates any exceptions from the consumer. + /// + /// A delegate that returns a value + /// The desired output type + /// The value from the function if the type is correct + private static T To(Func srcValue) + { + try { return srcValue(); } + catch { return default(T); } + } + + /// + /// Converts an incoming object to the expected type by treating the incoming object as a dynamic, and coping the expected values. + /// + /// the incoming object + /// EventData + public static EventData ConvertFrom(dynamic sourceValue) + { + return new EventData + { + Id = To(() => sourceValue.Id), + Message = To(() => sourceValue.Message), + Parameter = To(() => sourceValue.Parameter), + Value = To(() => sourceValue.Value), + RequestMessage = To(() => sourceValue.RequestMessage), + ResponseMessage = To(() => sourceValue.ResponseMessage), + Cancel = To(() => sourceValue.Cancel) + }; + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/EventListener.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/EventListener.cs new file mode 100644 index 000000000000..3bbea926faad --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Events.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Events.cs new file mode 100644 index 000000000000..88bbe4e10f4a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/EventsExtensions.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/EventsExtensions.cs new file mode 100644 index 000000000000..c666f2edd40c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/EventsExtensions.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 CmdletProcessRecordStart = nameof(CmdletProcessRecordStart); + public const string CmdletProcessRecordAsyncStart = nameof(CmdletProcessRecordAsyncStart); + public const string CmdletException = nameof(CmdletException); + public const string CmdletGetPipeline = nameof(CmdletGetPipeline); + public const string CmdletBeforeAPICall = nameof(CmdletBeforeAPICall); + public const string CmdletBeginProcessing = nameof(CmdletBeginProcessing); + public const string CmdletEndProcessing = nameof(CmdletEndProcessing); + public const string CmdletProcessRecordEnd = nameof(CmdletProcessRecordEnd); + public const string CmdletProcessRecordAsyncEnd = nameof(CmdletProcessRecordAsyncEnd); + public const string CmdletAfterAPICall = nameof(CmdletAfterAPICall); + + public const string Verbose = nameof(Verbose); + public const string Debug = nameof(Debug); + public const string Information = nameof(Information); + public const string Error = nameof(Error); + public const string Warning = nameof(Warning); + } + +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Extensions.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Extensions.cs new file mode 100644 index 000000000000..c2f5c5f6f7ab --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs new file mode 100644 index 000000000000..36985016a162 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Helpers/Extensions/TypeExtensions.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Helpers/Extensions/TypeExtensions.cs new file mode 100644 index 000000000000..c68d79f90c16 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Helpers/Seperator.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Helpers/Seperator.cs new file mode 100644 index 000000000000..feefa7e7dc1e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Helpers/TypeDetails.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Helpers/TypeDetails.cs new file mode 100644 index 000000000000..72f80462b988 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Helpers/XHelper.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Helpers/XHelper.cs new file mode 100644 index 000000000000..bb274146f707 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/HttpPipeline.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/HttpPipeline.cs new file mode 100644 index 000000000000..ff88ab46fb35 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/HttpPipeline.cs @@ -0,0 +1,88 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + + using GetEventData = System.Func; + using NextDelegate = System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>; + + using SignalDelegate = System.Func, System.Threading.Tasks.Task>; + using GetParameterDelegate = System.Func, string, object>; + using SendAsyncStepDelegate = System.Func, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>; + using PipelineChangeDelegate = System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>; + using ModuleLoadPipelineDelegate = System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>>; + using NewRequestPipelineDelegate = System.Action, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>>; + +/* + public class DelegateBasedEventListener : IEventListener + { + private EventListenerDelegate _listener; + public DelegateBasedEventListener(EventListenerDelegate listener) + { + _listener = listener; + } + public CancellationToken Token => CancellationToken.None; + public System.Action Cancel => () => { }; + + + public Task Signal(string id, CancellationToken token, GetEventData createMessage) + { + return _listener(id, token, () => createMessage()); + } + } +*/ + /// + /// This is a necessary extension to the SendAsyncFactory to support the 'generic' delegate format. + /// + public partial class SendAsyncFactory + { + /// + /// This translates a generic-defined delegate for a listener into one that fits our ISendAsync pattern. + /// (Provided to support out-of-module delegation for Azure Cmdlets) + /// + /// The Pipeline Step as a delegate + public SendAsyncFactory(SendAsyncStepDelegate step) => this.implementation = (request, listener, next) => + step( + request, + listener.Token, + listener.Cancel, + (id, token, getEventData) => listener.Signal(id, token, () => { + var data = EventDataConverter.ConvertFrom( getEventData() ) as EventData; + data.Id = id; + data.Cancel = listener.Cancel; + data.RequestMessage = request; + return data; + }), + (req, token, cancel, listenerDelegate) => next.SendAsync(req, listener)); + } + + public partial class HttpPipeline : ISendAsync + { + public HttpPipeline Append(SendAsyncStepDelegate item) + { + if (item != null) + { + Append(new SendAsyncFactory(item)); + } + return this; + } + + public HttpPipeline Prepend(SendAsyncStepDelegate item) + { + if (item != null) + { + Prepend(new SendAsyncFactory(item)); + } + return this; + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/HttpPipelineMocking.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/HttpPipelineMocking.ps1 new file mode 100644 index 000000000000..3371a6098821 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/HttpPipelineMocking.ps1 @@ -0,0 +1,110 @@ +$ErrorActionPreference = "Stop" + +# get the recording path +if (-not $TestRecordingFile) { + $TestRecordingFile = Join-Path $PSScriptRoot 'recording.json' +} + +# create the Http Pipeline Recorder +$Mock = New-Object -Type Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PipelineMock $TestRecordingFile + +# set the recorder to the appropriate mode (default to 'live') +Write-Host -ForegroundColor Green "Running '$TestMode' mode..." +switch ($TestMode) { + 'record' { + Write-Host -ForegroundColor Green "Recording to $TestRecordingFile" + $Mock.SetRecord() + $null = erase -ea 0 $TestRecordingFile + } + 'playback' { + if (-not (Test-Path $TestRecordingFile)) { + Write-Host -fore:yellow "Recording file '$TestRecordingFile' is not present. Tests expecting recorded responses will fail" + } else { + Write-Host -ForegroundColor Green "Using recording $TestRecordingFile" + } + $Mock.SetPlayback() + $Mock.ForceResponseHeaders["Retry-After"] = "0"; + } + default: { + $Mock.SetLive() + } +} + +# overrides for Pester Describe/Context/It + +function Describe( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Name, + + [Alias('Tags')] + [string[]] $Tag = @(), + + [Parameter(Position = 1)] + [ValidateNotNull()] + [ScriptBlock] $Fixture = $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") +) { + $Mock.PushDescription($Name) + try { + return pester\Describe -Name $Name -Tag $Tag -Fixture $fixture + } + finally { + $Mock.PopDescription() + } +} + +function Context( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Name, + + [Alias('Tags')] + [string[]] $Tag = @(), + + [Parameter(Position = 1)] + [ValidateNotNull()] + [ScriptBlock] $Fixture = $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") +) { + $Mock.PushContext($Name) + try { + return pester\Context -Name $Name -Tag $Tag -Fixture $fixture + } + finally { + $Mock.PopContext() + } +} + +function It { + [CmdletBinding(DefaultParameterSetName = 'Normal')] + param( + [Parameter(Mandatory = $true, Position = 0)] + [string]$Name, + + [Parameter(Position = 1)] + [ScriptBlock] $Test = { }, + + [System.Collections.IDictionary[]] $TestCases, + + [Parameter(ParameterSetName = 'Pending')] + [Switch] $Pending, + + [Parameter(ParameterSetName = 'Skip')] + [Alias('Ignore')] + [Switch] $Skip + ) + $Mock.PushScenario($Name) + + try { + if ($skip) { + return pester\It -Name $Name -Test $Test -TestCases $TestCases -Skip + } + if ($pending) { + return pester\It -Name $Name -Test $Test -TestCases $TestCases -Pending + } + return pester\It -Name $Name -Test $Test -TestCases $TestCases + } + finally { + $null = $Mock.PopScenario() + } +} + +# set the HttpPipelineAppend for all the cmdlets +$PSDefaultParameterValues["*:HttpPipelinePrepend"] = $Mock diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/IAssociativeArray.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/IAssociativeArray.cs new file mode 100644 index 000000000000..f3c81da7eae5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/IHeaderSerializable.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/IHeaderSerializable.cs new file mode 100644 index 000000000000..9cb1162500b5 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/ISendAsync.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/ISendAsync.cs new file mode 100644 index 000000000000..926f91c23e05 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/ISendAsync.cs @@ -0,0 +1,300 @@ +/*--------------------------------------------------------------------------------------------- + * 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.DefaultTag/generated/runtime/InfoAttribute.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/InfoAttribute.cs new file mode 100644 index 000000000000..ba76050cd5af --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Iso/IsoDate.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Iso/IsoDate.cs new file mode 100644 index 000000000000..db644708016b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/JsonType.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/JsonType.cs new file mode 100644 index 000000000000..b0bfde2b2e61 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/MessageAttribute.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/MessageAttribute.cs new file mode 100644 index 000000000000..dbe1d7ca923a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/MessageAttribute.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. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.generated.runtime.Properties; + using System; + using System.Collections.Generic; + using System.Globalization; + using System.Linq; + using System.Management.Automation; + using System.Text; + + [AttributeUsage(AttributeTargets.All)] + public class GenericBreakingChangeAttribute : Attribute + { + private string _message; + //A dexcription of what the change is about, non mandatory + public string ChangeDescription { get; set; } = null; + + //The version the change is effective from, non mandatory + public string DeprecateByVersion { get; } + public string DeprecateByAzVersion { get; } + + //The date on which the change comes in effect + public DateTime ChangeInEfectByDate { get; } + public bool ChangeInEfectByDateSet { get; } = false; + + //Old way of calling the cmdlet + public string OldWay { get; set; } + //New way fo calling the cmdlet + public string NewWay { get; set; } + + public GenericBreakingChangeAttribute(string message, string deprecateByAzVersion, string deprecateByVersion) + { + _message = message; + this.DeprecateByAzVersion = deprecateByAzVersion; + this.DeprecateByVersion = deprecateByVersion; + } + + public GenericBreakingChangeAttribute(string message, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) + { + _message = message; + this.DeprecateByVersion = deprecateByVersion; + this.DeprecateByAzVersion = deprecateByAzVersion; + + if (DateTime.TryParse(changeInEfectByDate, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) + { + this.ChangeInEfectByDate = result; + this.ChangeInEfectByDateSet = true; + } + } + + public DateTime getInEffectByDate() + { + return this.ChangeInEfectByDate.Date; + } + + + /** + * This function prints out the breaking change message for the attribute on the cmdline + * */ + public void PrintCustomAttributeInfo(Action writeOutput) + { + + if (!GetAttributeSpecificMessage().StartsWith(Environment.NewLine)) + { + writeOutput(Environment.NewLine); + } + writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessage, GetAttributeSpecificMessage())); + + + if (!string.IsNullOrWhiteSpace(ChangeDescription)) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesChangeDescriptionMessage, this.ChangeDescription)); + } + + if (ChangeInEfectByDateSet) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByDateMessage, this.ChangeInEfectByDate.ToString("d"))); + } + + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByAzVersion, this.DeprecateByAzVersion)); + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); + + if (OldWay != null && NewWay != null) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesUsageChangeMessageConsole, OldWay, NewWay)); + } + } + + public virtual bool IsApplicableToInvocation(InvocationInfo invocation) + { + return true; + } + + protected virtual string GetAttributeSpecificMessage() + { + return _message; + } + } + + [AttributeUsage(AttributeTargets.All)] + public class CmdletBreakingChangeAttribute : GenericBreakingChangeAttribute + { + + public string ReplacementCmdletName { get; set; } + + public CmdletBreakingChangeAttribute(string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) + { + } + + public CmdletBreakingChangeAttribute(string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) + { + } + + protected override string GetAttributeSpecificMessage() + { + if (string.IsNullOrWhiteSpace(ReplacementCmdletName)) + { + return Resources.BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement; + } + else + { + return string.Format(Resources.BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement, ReplacementCmdletName); + } + } + } + + [AttributeUsage(AttributeTargets.All)] + public class ParameterSetBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string[] ChangedParameterSet { set; get; } + + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) + { + ChangedParameterSet = changedParameterSet; + } + + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) + { + ChangedParameterSet = changedParameterSet; + } + + protected override string GetAttributeSpecificMessage() + { + + return Resources.BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement; + + } + + public bool IsApplicableToInvocation(InvocationInfo invocation, string parameterSetName) + { + if (ChangedParameterSet != null) + return ChangedParameterSet.Contains(parameterSetName); + return false; + } + + } + + [AttributeUsage(AttributeTargets.All)] + public class PreviewMessageAttribute : Attribute + { + public string _message; + + public DateTime EstimatedGaDate { get; } + + public bool IsEstimatedGaDateSet { get; } = false; + + + public PreviewMessageAttribute() + { + this._message = Resources.PreviewCmdletMessage; + } + + public PreviewMessageAttribute(string message) + { + this._message = string.IsNullOrEmpty(message) ? Resources.PreviewCmdletMessage : message; + } + + public PreviewMessageAttribute(string message, string estimatedDateOfGa) : this(message) + { + if (DateTime.TryParse(estimatedDateOfGa, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) + { + this.EstimatedGaDate = result; + this.IsEstimatedGaDateSet = true; + } + } + + public void PrintCustomAttributeInfo(Action writeOutput) + { + writeOutput(this._message); + + if (IsEstimatedGaDateSet) + { + writeOutput(string.Format(Resources.PreviewCmdletETAMessage, this.EstimatedGaDate.ToShortDateString())); + } + } + + public virtual bool IsApplicableToInvocation(InvocationInfo invocation) + { + return true; + } + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class ParameterBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string NameOfParameterChanging { get; } + + public string ReplaceMentCmdletParameterName { get; set; } = null; + + public bool IsBecomingMandatory { get; set; } = false; + + public String OldParamaterType { get; set; } + + public String NewParameterType { get; set; } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + protected override string GetAttributeSpecificMessage() + { + StringBuilder message = new StringBuilder(); + if (!string.IsNullOrWhiteSpace(ReplaceMentCmdletParameterName)) + { + if (IsBecomingMandatory) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplacedMandatory, NameOfParameterChanging, ReplaceMentCmdletParameterName)); + } + else + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplaced, NameOfParameterChanging, ReplaceMentCmdletParameterName)); + } + } + else + { + if (IsBecomingMandatory) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterMandatoryNow, NameOfParameterChanging)); + } + else + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterChanging, NameOfParameterChanging)); + } + } + + //See if the type of the param is changing + if (OldParamaterType != null && !string.IsNullOrWhiteSpace(NewParameterType)) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterTypeChange, OldParamaterType, NewParameterType)); + } + return message.ToString(); + } + + /// + /// See if the bound parameters contain the current parameter, if they do + /// then the attribbute is applicable + /// If the invocationInfo is null we return true + /// + /// + /// bool + public override bool IsApplicableToInvocation(InvocationInfo invocationInfo) + { + bool? applicable = invocationInfo == null ? true : invocationInfo.BoundParameters?.Keys?.Contains(this.NameOfParameterChanging); + return applicable.HasValue ? applicable.Value : false; + } + } + + [AttributeUsage(AttributeTargets.All)] + public class OutputBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string DeprecatedCmdLetOutputType { get; } + + //This is still a String instead of a Type as this + //might be undefined at the time of adding the attribute + public string ReplacementCmdletOutputType { get; set; } + + public string[] DeprecatedOutputProperties { get; set; } + + public string[] NewOutputProperties { get; set; } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + protected override string GetAttributeSpecificMessage() + { + StringBuilder message = new StringBuilder(); + + //check for the deprecation scenario + if (string.IsNullOrWhiteSpace(ReplacementCmdletOutputType) && NewOutputProperties == null && DeprecatedOutputProperties == null && string.IsNullOrWhiteSpace(ChangeDescription)) + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputTypeDeprecated, DeprecatedCmdLetOutputType)); + } + else + { + if (!string.IsNullOrWhiteSpace(ReplacementCmdletOutputType)) + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange1, DeprecatedCmdLetOutputType, ReplacementCmdletOutputType)); + } + else + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange2, DeprecatedCmdLetOutputType)); + } + + if (DeprecatedOutputProperties != null && DeprecatedOutputProperties.Length > 0) + { + message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesRemoved); + foreach (string property in DeprecatedOutputProperties) + { + message.Append(" '" + property + "'"); + } + } + + if (NewOutputProperties != null && NewOutputProperties.Length > 0) + { + message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesAdded); + foreach (string property in NewOutputProperties) + { + message.Append(" '" + property + "'"); + } + } + } + return message.ToString(); + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/MessageAttributeHelper.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/MessageAttributeHelper.cs new file mode 100644 index 000000000000..b7d51af550a0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/MessageAttributeHelper.cs @@ -0,0 +1,184 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.generated.runtime.Properties; + using System; + using System.Collections.Generic; + using System.Linq; + using System.Management.Automation; + using System.Reflection; + using System.Text; + using System.Threading.Tasks; + public class MessageAttributeHelper + { + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public const string BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK = "https://aka.ms/azps-changewarnings"; + public const string SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME = "SuppressAzurePowerShellBreakingChangeWarnings"; + + /** + * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) + * And reads all the deprecation attributes attached to it + * Prints a message on the cmdline For each of the attribute found + * + * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, + * We only process the Parameter beaking change attributes attached only params listed in this list (if present) + * */ + public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet, bool showPreviewMessage = true) + { + bool supressWarningOrError = false; + + try + { + supressWarningOrError = bool.Parse(System.Environment.GetEnvironmentVariable(SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME)); + } + catch (Exception) + { + //no action + } + + if (supressWarningOrError) + { + //Do not process the attributes at runtime... The env variable to override the warning messages is set + return; + } + if (IsAzure && invocationInfo.BoundParameters.ContainsKey("DefaultProfile")) + { + psCmdlet.WriteWarning("The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription."); + } + + ProcessBreakingChangeAttributesAtRuntime(commandInfo, invocationInfo, parameterSet, psCmdlet); + + } + + private static void ProcessBreakingChangeAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { + List attributes = new List(GetAllBreakingChangeAttributesInType(commandInfo, invocationInfo, parameterSet)); + StringBuilder sb = new StringBuilder(); + Action appendAttributeMessage = (string s) => sb.Append(s); + + if (attributes != null && attributes.Count > 0) + { + appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); + + foreach (GenericBreakingChangeAttribute attribute in attributes) + { + attribute.PrintCustomAttributeInfo(appendAttributeMessage); + } + + appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + + psCmdlet.WriteWarning(sb.ToString()); + } + } + + + public static void ProcessPreviewMessageAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { + List previewAttributes = new List(GetAllPreviewAttributesInType(commandInfo, invocationInfo)); + StringBuilder sb = new StringBuilder(); + Action appendAttributeMessage = (string s) => sb.Append(s); + + if (previewAttributes != null && previewAttributes.Count > 0) + { + foreach (PreviewMessageAttribute attribute in previewAttributes) + { + attribute.PrintCustomAttributeInfo(appendAttributeMessage); + } + psCmdlet.WriteWarning(sb.ToString()); + } + } + + /** + * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) + * And returns all the deprecation attributes attached to it + * + * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, + * We only process the Parameter beaking change attributes attached only params listed in this list (if present) + **/ + private static IEnumerable GetAllBreakingChangeAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet) + { + List attributeList = new List(); + + if (commandInfo.GetType() == typeof(CmdletInfo)) + { + var type = ((CmdletInfo)commandInfo).ImplementingType; + attributeList.AddRange(type.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + + foreach (MethodInfo m in type.GetRuntimeMethods()) + { + attributeList.AddRange((m.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast())); + } + + foreach (FieldInfo f in type.GetRuntimeFields()) + { + attributeList.AddRange(f.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + } + + foreach (PropertyInfo p in type.GetRuntimeProperties()) + { + attributeList.AddRange(p.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + } + } + else if (commandInfo.GetType() == typeof(FunctionInfo)) + { + attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast()); + foreach (var parameter in ((FunctionInfo)commandInfo).Parameters) + { + attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast()); + } + } + return invocationInfo == null ? attributeList : attributeList.Where(e => e.GetType() == typeof(ParameterSetBreakingChangeAttribute) ? ((ParameterSetBreakingChangeAttribute)e).IsApplicableToInvocation(invocationInfo, parameterSet) : e.IsApplicableToInvocation(invocationInfo)); + } + + public static bool ContainsPreviewAttribute(CommandInfo commandInfo, InvocationInfo invocationInfo) + { + return GetAllPreviewAttributesInType(commandInfo, invocationInfo)?.Count() > 0; + } + + private static IEnumerable GetAllPreviewAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo) + { + List attributeList = new List(); + if (commandInfo.GetType() == typeof(CmdletInfo)) + { + var type = ((CmdletInfo)commandInfo).ImplementingType; + attributeList.AddRange(type.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + + foreach (MethodInfo m in type.GetRuntimeMethods()) + { + attributeList.AddRange((m.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast())); + } + + foreach (FieldInfo f in type.GetRuntimeFields()) + { + attributeList.AddRange(f.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + } + + foreach (PropertyInfo p in type.GetRuntimeProperties()) + { + attributeList.AddRange(p.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + } + } + else if (commandInfo.GetType() == typeof(FunctionInfo)) + { + attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast()); + foreach (var parameter in ((FunctionInfo)commandInfo).Parameters) + { + attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast()); + } + } + return invocationInfo == null ? attributeList : attributeList.Where(e => e.IsApplicableToInvocation(invocationInfo)); + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Method.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Method.cs new file mode 100644 index 000000000000..ee2f19ec1075 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Models/JsonMember.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Models/JsonMember.cs new file mode 100644 index 000000000000..d0c0faecd5c4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Models/JsonModel.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Models/JsonModel.cs new file mode 100644 index 000000000000..cd34e7d51318 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Models/JsonModelCache.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Models/JsonModelCache.cs new file mode 100644 index 000000000000..f6f379219e9d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Nodes/Collections/JsonArray.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Nodes/Collections/JsonArray.cs new file mode 100644 index 000000000000..65fcf055ef0e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Nodes/Collections/XImmutableArray.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Nodes/Collections/XImmutableArray.cs new file mode 100644 index 000000000000..222eb104e7a0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Nodes/Collections/XList.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Nodes/Collections/XList.cs new file mode 100644 index 000000000000..8016079b1e45 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Nodes/Collections/XNodeArray.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Nodes/Collections/XNodeArray.cs new file mode 100644 index 000000000000..89ccec74562c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Nodes/Collections/XSet.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Nodes/Collections/XSet.cs new file mode 100644 index 000000000000..40026dad8bca --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Nodes/JsonBoolean.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Nodes/JsonBoolean.cs new file mode 100644 index 000000000000..ce3386cae623 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Nodes/JsonDate.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Nodes/JsonDate.cs new file mode 100644 index 000000000000..5c04b5f6208a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Nodes/JsonNode.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Nodes/JsonNode.cs new file mode 100644 index 000000000000..e4c62f076728 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Nodes/JsonNumber.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Nodes/JsonNumber.cs new file mode 100644 index 000000000000..74497b1bb07e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Nodes/JsonObject.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Nodes/JsonObject.cs new file mode 100644 index 000000000000..e106425dd549 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Nodes/JsonString.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Nodes/JsonString.cs new file mode 100644 index 000000000000..1de1f24d2e8a --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Nodes/XBinary.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Nodes/XBinary.cs new file mode 100644 index 000000000000..b8a6b6d24f9b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Nodes/XNull.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Nodes/XNull.cs new file mode 100644 index 000000000000..a507ac951117 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Parser/Exceptions/ParseException.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Parser/Exceptions/ParseException.cs new file mode 100644 index 000000000000..5bc9c4b662db --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Parser/JsonParser.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Parser/JsonParser.cs new file mode 100644 index 000000000000..4495d790d22c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Parser/JsonToken.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Parser/JsonToken.cs new file mode 100644 index 000000000000..cf962a2c17c6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Parser/JsonTokenizer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Parser/JsonTokenizer.cs new file mode 100644 index 000000000000..bec239ef1856 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Parser/Location.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Parser/Location.cs new file mode 100644 index 000000000000..0ef605d22fb3 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Parser/Readers/SourceReader.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Parser/Readers/SourceReader.cs new file mode 100644 index 000000000000..8a06d50e9d0e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Parser/TokenReader.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Parser/TokenReader.cs new file mode 100644 index 000000000000..675c919f720e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/PipelineMocking.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/PipelineMocking.cs new file mode 100644 index 000000000000..bbf13afd6946 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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); + } + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Properties/Resources.Designer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Properties/Resources.Designer.cs new file mode 100644 index 000000000000..a295dd4bae1e --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Properties/Resources.Designer.cs @@ -0,0 +1,5655 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.generated.runtime.Properties +{ + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.generated.runtime.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to The remote server returned an error: (401) Unauthorized.. + /// + public static string AccessDeniedExceptionMessage + { + get + { + return ResourceManager.GetString("AccessDeniedExceptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account id doesn't match one in subscription.. + /// + public static string AccountIdDoesntMatchSubscription + { + get + { + return ResourceManager.GetString("AccountIdDoesntMatchSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account needs to be specified. + /// + public static string AccountNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("AccountNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account "{0}" has been added.. + /// + public static string AddAccountAdded + { + get + { + return ResourceManager.GetString("AddAccountAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To switch to a different subscription, please use Select-AzureSubscription.. + /// + public static string AddAccountChangeSubscription + { + get + { + return ResourceManager.GetString("AddAccountChangeSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Skipping external tenant {0}, because you are using a guest or a foreign principal object identity. In order to access this tenant, please run Add-AzureAccount without "-Credential".. + /// + public static string AddAccountNonInteractiveGuestOrFpo + { + get + { + return ResourceManager.GetString("AddAccountNonInteractiveGuestOrFpo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription "{0}" is selected as the default subscription.. + /// + public static string AddAccountShowDefaultSubscription + { + get + { + return ResourceManager.GetString("AddAccountShowDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To view all the subscriptions, please use Get-AzureSubscription.. + /// + public static string AddAccountViewSubscriptions + { + get + { + return ResourceManager.GetString("AddAccountViewSubscriptions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} is created successfully.. + /// + public static string AddOnCreatedMessage + { + get + { + return ResourceManager.GetString("AddOnCreatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-on name {0} is already used.. + /// + public static string AddOnNameAlreadyUsed + { + get + { + return ResourceManager.GetString("AddOnNameAlreadyUsed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} not found.. + /// + public static string AddOnNotFound + { + get + { + return ResourceManager.GetString("AddOnNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-on {0} is removed successfully.. + /// + public static string AddOnRemovedMessage + { + get + { + return ResourceManager.GetString("AddOnRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} is updated successfully.. + /// + public static string AddOnUpdatedMessage + { + get + { + return ResourceManager.GetString("AddOnUpdatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}.. + /// + public static string AddRoleMessageCreate + { + get + { + return ResourceManager.GetString("AddRoleMessageCreate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for Node.js by running ‘npm install azure’.. + /// + public static string AddRoleMessageCreateNode + { + get + { + return ResourceManager.GetString("AddRoleMessageCreateNode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for PHP by running "pear WindowsAzure/WindowsAzure".. + /// + public static string AddRoleMessageCreatePHP + { + get + { + return ResourceManager.GetString("AddRoleMessageCreatePHP", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to set role permissions. Please give the 'Network Service' user 'Read & execute' and 'Modify' permissions to the role folder, or run PowerShell as an Administrator. + /// + public static string AddRoleMessageInsufficientPermissions + { + get + { + return ResourceManager.GetString("AddRoleMessageInsufficientPermissions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A role name '{0}' already exists. + /// + public static string AddRoleMessageRoleExists + { + get + { + return ResourceManager.GetString("AddRoleMessageRoleExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Profile {0} already has an endpoint with name {1}. + /// + public static string AddTrafficManagerEndpointFailed + { + get + { + return ResourceManager.GetString("AddTrafficManagerEndpointFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure PowerShell collects usage data in order to improve your experience. + ///The data is anonymous and does not include commandline argument values. + ///The data is collected by Microsoft. + /// + ///Use the Disable-AzDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Az.Accounts module. To disable data collection: PS > Disable-AzDataCollection. + ///Use the Enable-AzDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Az.Accounts module. To enable [rest of string was truncated]";. + /// + public static string ARMDataCollectionMessage + { + get + { + return ResourceManager.GetString("ARMDataCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [Common.Authentication]: Authenticating for account {0} with single tenant {1}.. + /// + public static string AuthenticatingForSingleTenant + { + get + { + return ResourceManager.GetString("AuthenticatingForSingleTenant", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Windows Azure Powershell\. + /// + public static string AzureDirectory + { + get + { + return ResourceManager.GetString("AzureDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://manage.windowsazure.com. + /// + public static string AzurePortalUrl + { + get + { + return ResourceManager.GetString("AzurePortalUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_PORTAL_URL. + /// + public static string AzurePortalUrlEnv + { + get + { + return ResourceManager.GetString("AzurePortalUrlEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Selected profile must not be null.. + /// + public static string AzureProfileMustNotBeNull + { + get + { + return ResourceManager.GetString("AzureProfileMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure SDK\{0}\. + /// + public static string AzureSdkDirectory + { + get + { + return ResourceManager.GetString("AzureSdkDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File '{0}' already exists. Use the -Force parameter to overwrite it.. + /// + public static string AzureVMDscArchiveAlreadyExists + { + get + { + return ResourceManager.GetString("AzureVMDscArchiveAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find configuration data file: {0}. + /// + public static string AzureVMDscCannotFindConfigurationDataFile + { + get + { + return ResourceManager.GetString("AzureVMDscCannotFindConfigurationDataFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Create Archive. + /// + public static string AzureVMDscCreateArchiveAction + { + get + { + return ResourceManager.GetString("AzureVMDscCreateArchiveAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The configuration data must be a .psd1 file. + /// + public static string AzureVMDscInvalidConfigurationDataFile + { + get + { + return ResourceManager.GetString("AzureVMDscInvalidConfigurationDataFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parsing configuration script: {0}. + /// + public static string AzureVMDscParsingConfiguration + { + get + { + return ResourceManager.GetString("AzureVMDscParsingConfiguration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Storage Blob '{0}' already exists. Use the -Force parameter to overwrite it.. + /// + public static string AzureVMDscStorageBlobAlreadyExists + { + get + { + return ResourceManager.GetString("AzureVMDscStorageBlobAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Upload '{0}'. + /// + public static string AzureVMDscUploadToBlobStorageAction + { + get + { + return ResourceManager.GetString("AzureVMDscUploadToBlobStorageAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Execution failed because a background thread could not prompt the user.. + /// + public static string BaseShouldMethodFailureReason + { + get + { + return ResourceManager.GetString("BaseShouldMethodFailureReason", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Base Uri was empty.. + /// + public static string BaseUriEmpty + { + get + { + return ResourceManager.GetString("BaseUriEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} begin processing without ParameterSet.. + /// + public static string BeginProcessingWithoutParameterSetLog + { + get + { + return ResourceManager.GetString("BeginProcessingWithoutParameterSetLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} begin processing with ParameterSet '{1}'.. + /// + public static string BeginProcessingWithParameterSetLog + { + get + { + return ResourceManager.GetString("BeginProcessingWithParameterSetLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Blob with the name {0} already exists in the account.. + /// + public static string BlobAlreadyExistsInTheAccount + { + get + { + return ResourceManager.GetString("BlobAlreadyExistsInTheAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://{0}.blob.core.windows.net/. + /// + public static string BlobEndpointUri + { + get + { + return ResourceManager.GetString("BlobEndpointUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_BLOBSTORAGE_TEMPLATE. + /// + public static string BlobEndpointUriEnv + { + get + { + return ResourceManager.GetString("BlobEndpointUriEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is changing.. + /// + public static string BreakingChangeAttributeParameterChanging + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterChanging", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is becoming mandatory.. + /// + public static string BreakingChangeAttributeParameterMandatoryNow + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterMandatoryNow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is being replaced by parameter : '{1}'.. + /// + public static string BreakingChangeAttributeParameterReplaced + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterReplaced", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is being replaced by mandatory parameter : '{1}'.. + /// + public static string BreakingChangeAttributeParameterReplacedMandatory + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterReplacedMandatory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type of the parameter is changing from '{0}' to '{1}'.. + /// + public static string BreakingChangeAttributeParameterTypeChange + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterTypeChange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change description : {0} + ///. + /// + public static string BreakingChangesAttributesChangeDescriptionMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesChangeDescriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet is being deprecated. There will be no replacement for it.. + /// + public static string BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet is being deprecated. There will be no replacement for it.. + /// + public static string BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet '{0}' is replacing this cmdlet.. + /// + public static string BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The output type is changing from the existing type :'{0}' to the new type :'{1}'. + /// + public static string BreakingChangesAttributesCmdLetOutputChange1 + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputChange1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "The output type '{0}' is changing". + /// + public static string BreakingChangesAttributesCmdLetOutputChange2 + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputChange2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to + ///- The following properties are being added to the output type : + ///. + /// + public static string BreakingChangesAttributesCmdLetOutputPropertiesAdded + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputPropertiesAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to + /// - The following properties in the output type are being deprecated : + ///. + /// + public static string BreakingChangesAttributesCmdLetOutputPropertiesRemoved + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputPropertiesRemoved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The output type '{0}' is being deprecated without a replacement.. + /// + public static string BreakingChangesAttributesCmdLetOutputTypeDeprecated + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputTypeDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - {0} + /// + ///. + /// + public static string BreakingChangesAttributesDeclarationMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesDeclarationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - Cmdlet : '{0}' + /// - {1} + ///. + /// + public static string BreakingChangesAttributesDeclarationMessageWithCmdletName + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesDeclarationMessageWithCmdletName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to NOTE : Go to {0} for steps to suppress (and other related information on) the breaking change messages.. + /// + public static string BreakingChangesAttributesFooterMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesFooterMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Breaking changes in the cmdlet '{0}' :. + /// + public static string BreakingChangesAttributesHeaderMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesHeaderMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note : This change will take effect on '{0}' + ///. + /// + public static string BreakingChangesAttributesInEffectByDateMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByDateMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note :The change is expected to take effect from version : '{0}' + /// + ///. + /// + public static string BreakingChangesAttributesInEffectByVersion + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note :The change is expected to take effect from az version : '{0}' + /// + ///. + /// + public static string BreakingChangesAttributesInEffectByAzVersion + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByAzVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ```powershell + ///# Old + ///{0} + /// + ///# New + ///{1} + ///``` + /// + ///. + /// + public static string BreakingChangesAttributesUsageChangeMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesUsageChangeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cmdlet invocation changes : + /// Old Way : {0} + /// New Way : {1}. + /// + public static string BreakingChangesAttributesUsageChangeMessageConsole + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesUsageChangeMessageConsole", resourceCulture); + } + } + + /// + /// The cmdlet is in experimental stage. The function may not be enabled in current subscription. + /// + public static string ExperimentalCmdletMessage + { + get + { + return ResourceManager.GetString("ExperimentalCmdletMessage", resourceCulture); + } + } + + + + /// + /// Looks up a localized string similar to CACHERUNTIMEURL. + /// + public static string CacheRuntimeUrl + { + get + { + return ResourceManager.GetString("CacheRuntimeUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to cache. + /// + public static string CacheRuntimeValue + { + get + { + return ResourceManager.GetString("CacheRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CacheRuntimeVersion. + /// + public static string CacheRuntimeVersionKey + { + get + { + return ResourceManager.GetString("CacheRuntimeVersionKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing caching version {0} for Role '{1}' (the caching version locally installed is: {2}). + /// + public static string CacheVersionWarningText + { + get + { + return ResourceManager.GetString("CacheVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot change built-in environment {0}.. + /// + public static string CannotChangeBuiltinEnvironment + { + get + { + return ResourceManager.GetString("CannotChangeBuiltinEnvironment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find {0} with name {1}.. + /// + public static string CannotFind + { + get + { + return ResourceManager.GetString("CannotFind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deployment for service {0} with {1} slot doesn't exist. + /// + public static string CannotFindDeployment + { + get + { + return ResourceManager.GetString("CannotFindDeployment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can't find valid Microsoft Azure role in current directory {0}. + /// + public static string CannotFindRole + { + get + { + return ResourceManager.GetString("CannotFindRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service {0} configuration file (ServiceConfiguration.Cloud.cscfg) is either null or doesn't exist. + /// + public static string CannotFindServiceConfigurationFile + { + get + { + return ResourceManager.GetString("CannotFindServiceConfigurationFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid service path! Cannot locate ServiceDefinition.csdef in current folder or parent folders.. + /// + public static string CannotFindServiceRoot + { + get + { + return ResourceManager.GetString("CannotFindServiceRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named {0} with id {1} is not currently imported. You must import this subscription before it can be updated.. + /// + public static string CannotUpdateUnknownSubscription + { + get + { + return ResourceManager.GetString("CannotUpdateUnknownSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ManagementCertificate. + /// + public static string CertificateElementName + { + get + { + return ResourceManager.GetString("CertificateElementName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to certificate.pfx. + /// + public static string CertificateFileName + { + get + { + return ResourceManager.GetString("CertificateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Certificate imported into CurrentUser\My\{0}. + /// + public static string CertificateImportedMessage + { + get + { + return ResourceManager.GetString("CertificateImportedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No certificate was found in the certificate store with thumbprint {0}. + /// + public static string CertificateNotFoundInStore + { + get + { + return ResourceManager.GetString("CertificateNotFoundInStore", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your account does not have access to the private key for certificate {0}. + /// + public static string CertificatePrivateKeyAccessError + { + get + { + return ResourceManager.GetString("CertificatePrivateKeyAccessError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} {1} deployment for {2} service. + /// + public static string ChangeDeploymentStateWaitMessage + { + get + { + return ResourceManager.GetString("ChangeDeploymentStateWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cloud service {0} is in {1} state.. + /// + public static string ChangeDeploymentStatusCompleteMessage + { + get + { + return ResourceManager.GetString("ChangeDeploymentStatusCompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changing/Removing public environment '{0}' is not allowed.. + /// + public static string ChangePublicEnvironmentMessage + { + get + { + return ResourceManager.GetString("ChangePublicEnvironmentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} is set to value {1}. + /// + public static string ChangeSettingsElementMessage + { + get + { + return ResourceManager.GetString("ChangeSettingsElementMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changing public environment is not supported.. + /// + public static string ChangingDefaultEnvironmentNotSupported + { + get + { + return ResourceManager.GetString("ChangingDefaultEnvironmentNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Choose which publish settings file to use:. + /// + public static string ChoosePublishSettingsFile + { + get + { + return ResourceManager.GetString("ChoosePublishSettingsFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel. + /// + public static string ClientDiagnosticLevelName + { + get + { + return ResourceManager.GetString("ClientDiagnosticLevelName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1. + /// + public static string ClientDiagnosticLevelValue + { + get + { + return ResourceManager.GetString("ClientDiagnosticLevelValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to cloud_package.cspkg. + /// + public static string CloudPackageFileName + { + get + { + return ResourceManager.GetString("CloudPackageFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceConfiguration.Cloud.cscfg. + /// + public static string CloudServiceConfigurationFileName + { + get + { + return ResourceManager.GetString("CloudServiceConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-ons for {0}. + /// + public static string CloudServiceDescription + { + get + { + return ResourceManager.GetString("CloudServiceDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Communication could not be established. This could be due to an invalid subscription ID. Note that subscription IDs are case sensitive.. + /// + public static string CommunicationCouldNotBeEstablished + { + get + { + return ResourceManager.GetString("CommunicationCouldNotBeEstablished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complete. + /// + public static string CompleteMessage + { + get + { + return ResourceManager.GetString("CompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OperationID : '{0}'. + /// + public static string ComputeCloudExceptionOperationIdMessage + { + get + { + return ResourceManager.GetString("ComputeCloudExceptionOperationIdMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to config.json. + /// + public static string ConfigurationFileName + { + get + { + return ResourceManager.GetString("ConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to VirtualMachine creation failed.. + /// + public static string CreateFailedErrorMessage + { + get + { + return ResourceManager.GetString("CreateFailedErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating the website failed. If this is the first website for this subscription, please create it using the management portal instead.. + /// + public static string CreateWebsiteFailed + { + get + { + return ResourceManager.GetString("CreateWebsiteFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core. + /// + public static string DataCacheClientsType + { + get + { + return ResourceManager.GetString("DataCacheClientsType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to //blobcontainer[@datacenter='{0}']. + /// + public static string DatacenterBlobQuery + { + get + { + return ResourceManager.GetString("DatacenterBlobQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft Azure PowerShell Data Collection Confirmation. + /// + public static string DataCollectionActivity + { + get + { + return ResourceManager.GetString("DataCollectionActivity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You choose not to participate in Microsoft Azure PowerShell data collection.. + /// + public static string DataCollectionConfirmNo + { + get + { + return ResourceManager.GetString("DataCollectionConfirmNo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This confirmation message will be dismissed in '{0}' second(s).... + /// + public static string DataCollectionConfirmTime + { + get + { + return ResourceManager.GetString("DataCollectionConfirmTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You choose to participate in Microsoft Azure PowerShell data collection.. + /// + public static string DataCollectionConfirmYes + { + get + { + return ResourceManager.GetString("DataCollectionConfirmYes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The setting profile has been saved to the following path '{0}'.. + /// + public static string DataCollectionSaveFileInformation + { + get + { + return ResourceManager.GetString("DataCollectionSaveFileInformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Setting: {0} as the default and current subscription. To view other subscriptions use Get-AzureSubscription. + /// + public static string DefaultAndCurrentSubscription + { + get + { + return ResourceManager.GetString("DefaultAndCurrentSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to none. + /// + public static string DefaultFileVersion + { + get + { + return ResourceManager.GetString("DefaultFileVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There are no hostnames which could be used for validation.. + /// + public static string DefaultHostnamesValidation + { + get + { + return ResourceManager.GetString("DefaultHostnamesValidation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 8080. + /// + public static string DefaultPort + { + get + { + return ResourceManager.GetString("DefaultPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1000. + /// + public static string DefaultRoleCachingInMB + { + get + { + return ResourceManager.GetString("DefaultRoleCachingInMB", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Auto. + /// + public static string DefaultUpgradeMode + { + get + { + return ResourceManager.GetString("DefaultUpgradeMode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 80. + /// + public static string DefaultWebPort + { + get + { + return ResourceManager.GetString("DefaultWebPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Delete. + /// + public static string Delete + { + get + { + return ResourceManager.GetString("Delete", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} slot for service {1} is already in {2} state. + /// + public static string DeploymentAlreadyInState + { + get + { + return ResourceManager.GetString("DeploymentAlreadyInState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The deployment in {0} slot for service {1} is removed. + /// + public static string DeploymentRemovedMessage + { + get + { + return ResourceManager.GetString("DeploymentRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel. + /// + public static string DiagnosticLevelName + { + get + { + return ResourceManager.GetString("DiagnosticLevelName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1. + /// + public static string DiagnosticLevelValue + { + get + { + return ResourceManager.GetString("DiagnosticLevelValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key to add already exists in the dictionary.. + /// + public static string DictionaryAddAlreadyContainsKey + { + get + { + return ResourceManager.GetString("DictionaryAddAlreadyContainsKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The array index cannot be less than zero.. + /// + public static string DictionaryCopyToArrayIndexLessThanZero + { + get + { + return ResourceManager.GetString("DictionaryCopyToArrayIndexLessThanZero", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The supplied array does not have enough room to contain the copied elements.. + /// + public static string DictionaryCopyToArrayTooShort + { + get + { + return ResourceManager.GetString("DictionaryCopyToArrayTooShort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided dns {0} doesn't exist. + /// + public static string DnsDoesNotExist + { + get + { + return ResourceManager.GetString("DnsDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft Azure Certificate. + /// + public static string EnableRemoteDesktop_FriendlyCertificateName + { + get + { + return ResourceManager.GetString("EnableRemoteDesktop_FriendlyCertificateName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Endpoint can't be retrieved for storage account. + /// + public static string EndPointNotFoundForBlobStorage + { + get + { + return ResourceManager.GetString("EndPointNotFoundForBlobStorage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} end processing.. + /// + public static string EndProcessingLog + { + get + { + return ResourceManager.GetString("EndProcessingLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To use Active Directory authentication, you must configure the ActiveDirectoryEndpoint, ActiveDirectoryTenantId, and ActiveDirectorServiceEndpointResourceId for environment of '{0}'. You can configure these properties for this environment using the Set-AzureEnvironment cmdlet.. + /// + public static string EnvironmentDoesNotSupportActiveDirectory + { + get + { + return ResourceManager.GetString("EnvironmentDoesNotSupportActiveDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The environment '{0}' already exists.. + /// + public static string EnvironmentExists + { + get + { + return ResourceManager.GetString("EnvironmentExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment name doesn't match one in subscription.. + /// + public static string EnvironmentNameDoesntMatchSubscription + { + get + { + return ResourceManager.GetString("EnvironmentNameDoesntMatchSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment name needs to be specified.. + /// + public static string EnvironmentNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("EnvironmentNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment needs to be specified.. + /// + public static string EnvironmentNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("EnvironmentNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The environment name '{0}' is not found.. + /// + public static string EnvironmentNotFound + { + get + { + return ResourceManager.GetString("EnvironmentNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to environments.xml. + /// + public static string EnvironmentsFileName + { + get + { + return ResourceManager.GetString("EnvironmentsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error creating VirtualMachine. + /// + public static string ErrorCreatingVirtualMachine + { + get + { + return ResourceManager.GetString("ErrorCreatingVirtualMachine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to download available runtimes for location '{0}'. + /// + public static string ErrorRetrievingRuntimesForLocation + { + get + { + return ResourceManager.GetString("ErrorRetrievingRuntimesForLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error updating VirtualMachine. + /// + public static string ErrorUpdatingVirtualMachine + { + get + { + return ResourceManager.GetString("ErrorUpdatingVirtualMachine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Job Id {0} failed. Error: {1}, ExceptionDetails: {2}. + /// + public static string FailedJobErrorMessage + { + get + { + return ResourceManager.GetString("FailedJobErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File path is not valid.. + /// + public static string FilePathIsNotValid + { + get + { + return ResourceManager.GetString("FilePathIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The HTTP request was forbidden with client authentication scheme 'Anonymous'.. + /// + public static string FirstPurchaseErrorMessage + { + get + { + return ResourceManager.GetString("FirstPurchaseErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This add-on requires you to purchase the first instance through the Microsoft Azure Portal. Subsequent purchases can be performed through PowerShell.. + /// + public static string FirstPurchaseMessage + { + get + { + return ResourceManager.GetString("FirstPurchaseMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation Status:. + /// + public static string GatewayOperationStatus + { + get + { + return ResourceManager.GetString("GatewayOperationStatus", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\General. + /// + public static string GeneralScaffolding + { + get + { + return ResourceManager.GetString("GeneralScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting all available Microsoft Azure Add-Ons, this may take few minutes.... + /// + public static string GetAllAddOnsWaitMessage + { + get + { + return ResourceManager.GetString("GetAllAddOnsWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Name{0}Primary Key{0}Seconday Key. + /// + public static string GetStorageKeysHeader + { + get + { + return ResourceManager.GetString("GetStorageKeysHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Git not found. Please install git and place it in your command line path.. + /// + public static string GitNotFound + { + get + { + return ResourceManager.GetString("GitNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find publish settings. Please run Import-AzurePublishSettingsFile.. + /// + public static string GlobalSettingsManager_Load_PublishSettingsNotFound + { + get + { + return ResourceManager.GetString("GlobalSettingsManager_Load_PublishSettingsNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the WadCfg end element in the config.. + /// + public static string IaasDiagnosticsBadConfigNoEndWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoEndWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WadCfg start element in the config is not matching the end element.. + /// + public static string IaasDiagnosticsBadConfigNoMatchingWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoMatchingWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the WadCfg element in the config.. + /// + public static string IaasDiagnosticsBadConfigNoWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode.dll. + /// + public static string IISNodeDll + { + get + { + return ResourceManager.GetString("IISNodeDll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode. + /// + public static string IISNodeEngineKey + { + get + { + return ResourceManager.GetString("IISNodeEngineKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode-dev\\release\\x64. + /// + public static string IISNodePath + { + get + { + return ResourceManager.GetString("IISNodePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode. + /// + public static string IISNodeRuntimeValue + { + get + { + return ResourceManager.GetString("IISNodeRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing IISNode version {0} in Azure for WebRole '{1}' (the version locally installed is: {2}). + /// + public static string IISNodeVersionWarningText + { + get + { + return ResourceManager.GetString("IISNodeVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Illegal characters in path.. + /// + public static string IllegalPath + { + get + { + return ResourceManager.GetString("IllegalPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. + /// + public static string InternalServerErrorMessage + { + get + { + return ResourceManager.GetString("InternalServerErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot enable memcach protocol on a cache worker role {0}.. + /// + public static string InvalidCacheRoleName + { + get + { + return ResourceManager.GetString("InvalidCacheRoleName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings. + /// + public static string InvalidCertificate + { + get + { + return ResourceManager.GetString("InvalidCertificate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid certificate format.. + /// + public static string InvalidCertificateSingle + { + get + { + return ResourceManager.GetString("InvalidCertificateSingle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided configuration path is invalid or doesn't exist. + /// + public static string InvalidConfigPath + { + get + { + return ResourceManager.GetString("InvalidConfigPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The country name is invalid, please use a valid two character country code, as described in ISO 3166-1 alpha-2.. + /// + public static string InvalidCountryNameMessage + { + get + { + return ResourceManager.GetString("InvalidCountryNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription.. + /// + public static string InvalidDefaultSubscription + { + get + { + return ResourceManager.GetString("InvalidDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deployment with {0} does not exist. + /// + public static string InvalidDeployment + { + get + { + return ResourceManager.GetString("InvalidDeployment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The deployment slot name {0} is invalid. Slot name must be either "Staging" or "Production".. + /// + public static string InvalidDeploymentSlot + { + get + { + return ResourceManager.GetString("InvalidDeploymentSlot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "{0}" is an invalid DNS name for {1}. + /// + public static string InvalidDnsName + { + get + { + return ResourceManager.GetString("InvalidDnsName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid service endpoint.. + /// + public static string InvalidEndpoint + { + get + { + return ResourceManager.GetString("InvalidEndpoint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided file in {0} must be have {1} extension. + /// + public static string InvalidFileExtension + { + get + { + return ResourceManager.GetString("InvalidFileExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File {0} has invalid characters. + /// + public static string InvalidFileName + { + get + { + return ResourceManager.GetString("InvalidFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must create your git publishing credentials using the Microsoft Azure portal. + ///Please follow these steps in the portal: + ///1. On the left side open "Web Sites" + ///2. Click on any website + ///3. Choose "Setup Git Publishing" or "Reset deployment credentials" + ///4. Back in the PowerShell window, rerun this command by typing "New-AzureWebSite {site name} -Git -PublishingUsername {username}. + /// + public static string InvalidGitCredentials + { + get + { + return ResourceManager.GetString("InvalidGitCredentials", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value {0} provided is not a valid GUID. Please provide a valid GUID.. + /// + public static string InvalidGuid + { + get + { + return ResourceManager.GetString("InvalidGuid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified hostname does not exist. Please specify a valid hostname for the site.. + /// + public static string InvalidHostnameValidation + { + get + { + return ResourceManager.GetString("InvalidHostnameValidation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} instances must be greater than or equal 0 and less than or equal 20. + /// + public static string InvalidInstancesCount + { + get + { + return ResourceManager.GetString("InvalidInstancesCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There was an error creating your webjob. Please make sure that the script is in the root folder of the zip file.. + /// + public static string InvalidJobFile + { + get + { + return ResourceManager.GetString("InvalidJobFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not download a valid runtime manifest, Please check your internet connection and try again.. + /// + public static string InvalidManifestError + { + get + { + return ResourceManager.GetString("InvalidManifestError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The account {0} was not found. Please specify a valid account name.. + /// + public static string InvalidMediaServicesAccount + { + get + { + return ResourceManager.GetString("InvalidMediaServicesAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided name "{0}" does not match the service bus namespace naming rules.. + /// + public static string InvalidNamespaceName + { + get + { + return ResourceManager.GetString("InvalidNamespaceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path must specify a valid path to an Azure profile.. + /// + public static string InvalidNewProfilePath + { + get + { + return ResourceManager.GetString("InvalidNewProfilePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value cannot be null. Parameter name: '{0}'. + /// + public static string InvalidNullArgument + { + get + { + return ResourceManager.GetString("InvalidNullArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is invalid or empty. + /// + public static string InvalidOrEmptyArgumentMessage + { + get + { + return ResourceManager.GetString("InvalidOrEmptyArgumentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided package path is invalid or doesn't exist. + /// + public static string InvalidPackagePath + { + get + { + return ResourceManager.GetString("InvalidPackagePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is an invalid parameter set name.. + /// + public static string InvalidParameterSetName + { + get + { + return ResourceManager.GetString("InvalidParameterSetName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} doesn't exist in {1} or you've not passed valid value for it. + /// + public static string InvalidPath + { + get + { + return ResourceManager.GetString("InvalidPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path {0} has invalid characters. + /// + public static string InvalidPathName + { + get + { + return ResourceManager.GetString("InvalidPathName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain one of the following sets of properties: {SubscriptionId, Certificate}, {SubscriptionId, Username, Password}, {SubscriptionId, ServicePrincipal, Password, Tenant}, {SubscriptionId, AccountId, Token}. + /// + public static string InvalidProfileProperties + { + get + { + return ResourceManager.GetString("InvalidProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile. + /// + public static string InvalidPublishSettingsSchema + { + get + { + return ResourceManager.GetString("InvalidPublishSettingsSchema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided role name "{0}" has invalid characters. + /// + public static string InvalidRoleNameMessage + { + get + { + return ResourceManager.GetString("InvalidRoleNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid name for the service root folder is required. + /// + public static string InvalidRootNameMessage + { + get + { + return ResourceManager.GetString("InvalidRootNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is not a recognized runtime type. + /// + public static string InvalidRuntimeError + { + get + { + return ResourceManager.GetString("InvalidRuntimeError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid language is required. + /// + public static string InvalidScaffoldingLanguageArg + { + get + { + return ResourceManager.GetString("InvalidScaffoldingLanguageArg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No subscription is currently selected. Use Select-Subscription to activate a subscription.. + /// + public static string InvalidSelectedSubscription + { + get + { + return ResourceManager.GetString("InvalidSelectedSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided location "{0}" does not exist in the available locations use Get-AzureSBLocation for listing available locations.. + /// + public static string InvalidServiceBusLocation + { + get + { + return ResourceManager.GetString("InvalidServiceBusLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide a service name or run this command from inside a service project directory.. + /// + public static string InvalidServiceName + { + get + { + return ResourceManager.GetString("InvalidServiceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must provide valid value for {0}. + /// + public static string InvalidServiceSettingElement + { + get + { + return ResourceManager.GetString("InvalidServiceSettingElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to settings.json is invalid or doesn't exist. + /// + public static string InvalidServiceSettingMessage + { + get + { + return ResourceManager.GetString("InvalidServiceSettingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named '{0}' cannot be found. Use Set-AzureSubscription to initialize the subscription data.. + /// + public static string InvalidSubscription + { + get + { + return ResourceManager.GetString("InvalidSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided subscription id {0} is not valid. + /// + public static string InvalidSubscriptionId + { + get + { + return ResourceManager.GetString("InvalidSubscriptionId", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Must specify a non-null subscription name.. + /// + public static string InvalidSubscriptionName + { + get + { + return ResourceManager.GetString("InvalidSubscriptionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet. + /// + public static string InvalidSubscriptionNameMessage + { + get + { + return ResourceManager.GetString("InvalidSubscriptionNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided subscriptions file {0} has invalid content.. + /// + public static string InvalidSubscriptionsDataSchema + { + get + { + return ResourceManager.GetString("InvalidSubscriptionsDataSchema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge.. + /// + public static string InvalidVMSize + { + get + { + return ResourceManager.GetString("InvalidVMSize", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The web job file must have *.zip extension. + /// + public static string InvalidWebJobFile + { + get + { + return ResourceManager.GetString("InvalidWebJobFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Singleton option works for continuous jobs only.. + /// + public static string InvalidWebJobSingleton + { + get + { + return ResourceManager.GetString("InvalidWebJobSingleton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The website {0} was not found. Please specify a valid website name.. + /// + public static string InvalidWebsite + { + get + { + return ResourceManager.GetString("InvalidWebsite", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No job for id: {0} was found.. + /// + public static string JobNotFound + { + get + { + return ResourceManager.GetString("JobNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to engines. + /// + public static string JsonEnginesSectionName + { + get + { + return ResourceManager.GetString("JsonEnginesSectionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scaffolding for this language is not yet supported. + /// + public static string LanguageScaffoldingIsNotSupported + { + get + { + return ResourceManager.GetString("LanguageScaffoldingIsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Link already established. + /// + public static string LinkAlreadyEstablished + { + get + { + return ResourceManager.GetString("LinkAlreadyEstablished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to local_package.csx. + /// + public static string LocalPackageFileName + { + get + { + return ResourceManager.GetString("LocalPackageFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceConfiguration.Local.cscfg. + /// + public static string LocalServiceConfigurationFileName + { + get + { + return ResourceManager.GetString("LocalServiceConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looking for {0} deployment for {1} cloud service.... + /// + public static string LookingForDeploymentMessage + { + get + { + return ResourceManager.GetString("LookingForDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looking for cloud service {0}.... + /// + public static string LookingForServiceMessage + { + get + { + return ResourceManager.GetString("LookingForServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure Long-Running Job. + /// + public static string LROJobName + { + get + { + return ResourceManager.GetString("LROJobName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet failed in background execution. The returned error was '{0}'. Please execute the cmdlet again. You may need to execute this cmdlet synchronously, by omitting the '-AsJob' parameter.. + /// + public static string LROTaskExceptionMessage + { + get + { + return ResourceManager.GetString("LROTaskExceptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to managementCertificate.pem. + /// + public static string ManagementCertificateFileName + { + get + { + return ResourceManager.GetString("ManagementCertificateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ?whr={0}. + /// + public static string ManagementPortalRealmFormat + { + get + { + return ResourceManager.GetString("ManagementPortalRealmFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to //baseuri. + /// + public static string ManifestBaseUriQuery + { + get + { + return ResourceManager.GetString("ManifestBaseUriQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uri. + /// + public static string ManifestBlobUriKey + { + get + { + return ResourceManager.GetString("ManifestBlobUriKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to http://az413943.vo.msecnd.net/node/runtimemanifest_0.7.5.2.xml. + /// + public static string ManifestUri + { + get + { + return ResourceManager.GetString("ManifestUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'Certificate' of type 'X509Certificate2'.. + /// + public static string MissingCertificateInProfileProperties + { + get + { + return ResourceManager.GetString("MissingCertificateInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'Password' with an associated 'Username' or 'ServicePrincipal'.. + /// + public static string MissingPasswordInProfileProperties + { + get + { + return ResourceManager.GetString("MissingPasswordInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'SubscriptionId'.. + /// + public static string MissingSubscriptionInProfileProperties + { + get + { + return ResourceManager.GetString("MissingSubscriptionInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple Add-Ons found holding name {0}. + /// + public static string MultipleAddOnsFoundMessage + { + get + { + return ResourceManager.GetString("MultipleAddOnsFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple possible publishing users. Please go to the Portal and use the listed deployment user, or click 'set/reset deployment credentials' to set up a new user account, then reurn this cmdlet and specify PublishingUsername.. + /// + public static string MultiplePublishingUsernames + { + get + { + return ResourceManager.GetString("MultiplePublishingUsernames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The first publish settings file "{0}" is used. If you want to use another file specify the file name.. + /// + public static string MultiplePublishSettingsFilesFoundMessage + { + get + { + return ResourceManager.GetString("MultiplePublishSettingsFilesFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.NamedCaches. + /// + public static string NamedCacheSettingName + { + get + { + return ResourceManager.GetString("NamedCacheSettingName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]}. + /// + public static string NamedCacheSettingValue + { + get + { + return ResourceManager.GetString("NamedCacheSettingValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A publishing username is required. Please specify one using the argument PublishingUsername.. + /// + public static string NeedPublishingUsernames + { + get + { + return ResourceManager.GetString("NeedPublishingUsernames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Add-On Confirmation. + /// + public static string NewAddOnConformation + { + get + { + return ResourceManager.GetString("NewAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my + ///contact information with {2}.. + /// + public static string NewMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("NewMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen because the namespace name is already used or due to an incorrect location name. Use Get-AzureSBLocation cmdlet to list valid names.. + /// + public static string NewNamespaceErrorMessage + { + get + { + return ResourceManager.GetString("NewNamespaceErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of + ///use and privacy statement at {0} and (c) agree to sharing my contact information with {2}.. + /// + public static string NewNonMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("NewNonMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service has been created at {0}. + /// + public static string NewServiceCreatedMessage + { + get + { + return ResourceManager.GetString("NewServiceCreatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No. + /// + public static string No + { + get + { + return ResourceManager.GetString("No", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no access token cached for subscription {0}, user id {1}. Use the Add-AzureAccount cmdlet to log in again and get a token for this subscription.. + /// + public static string NoCachedToken + { + get + { + return ResourceManager.GetString("NoCachedToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The service does not have any cache worker roles, add one first by running cmdlet Add-AzureCacheWorkerRole.. + /// + public static string NoCacheWorkerRoles + { + get + { + return ResourceManager.GetString("NoCacheWorkerRoles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No clouds available. + /// + public static string NoCloudsAvailable + { + get + { + return ResourceManager.GetString("NoCloudsAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "There is no current context, please log in using Connect-AzAccount.". + /// + public static string NoCurrentContextForDataCmdlet + { + get + { + return ResourceManager.GetString("NoCurrentContextForDataCmdlet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to nodejs. + /// + public static string NodeDirectory + { + get + { + return ResourceManager.GetString("NodeDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node. + /// + public static string NodeEngineKey + { + get + { + return ResourceManager.GetString("NodeEngineKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node.exe. + /// + public static string NodeExe + { + get + { + return ResourceManager.GetString("NodeExe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no default subscription set, please set a default subscription by running Set-AzureSubscription -Default <subscription name>. + /// + public static string NoDefaultSubscriptionMessage + { + get + { + return ResourceManager.GetString("NoDefaultSubscriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft SDKs\Azure\Nodejs\Nov2011. + /// + public static string NodeModulesPath + { + get + { + return ResourceManager.GetString("NodeModulesPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to nodejs. + /// + public static string NodeProgramFilesFolderName + { + get + { + return ResourceManager.GetString("NodeProgramFilesFolderName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node. + /// + public static string NodeRuntimeValue + { + get + { + return ResourceManager.GetString("NodeRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\Node. + /// + public static string NodeScaffolding + { + get + { + return ResourceManager.GetString("NodeScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.Node. + /// + public static string NodeScaffoldingResources + { + get + { + return ResourceManager.GetString("NodeScaffoldingResources", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing Node version {0} in Azure for Role '{1}' (the Node version locally installed is: {2}). + /// + public static string NodeVersionWarningText + { + get + { + return ResourceManager.GetString("NodeVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No, I do not agree. + /// + public static string NoHint + { + get + { + return ResourceManager.GetString("NoHint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please connect to internet before executing this cmdlet. + /// + public static string NoInternetConnection + { + get + { + return ResourceManager.GetString("NoInternetConnection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <NONE>. + /// + public static string None + { + get + { + return ResourceManager.GetString("None", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No publish settings files with extension *.publishsettings are found in the directory "{0}".. + /// + public static string NoPublishSettingsFilesFoundMessage + { + get + { + return ResourceManager.GetString("NoPublishSettingsFilesFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no subscription associated with account {0}.. + /// + public static string NoSubscriptionAddedMessage + { + get + { + return ResourceManager.GetString("NoSubscriptionAddedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Connect-AzAccount?. + /// + public static string NoSubscriptionFoundForTenant + { + get + { + return ResourceManager.GetString("NoSubscriptionFoundForTenant", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' must be a cache worker role. Verify that it has proper cache worker role configuration.. + /// + public static string NotCacheWorkerRole + { + get + { + return ResourceManager.GetString("NotCacheWorkerRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Certificate can't be null.. + /// + public static string NullCertificateMessage + { + get + { + return ResourceManager.GetString("NullCertificateMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} could not be null or empty. + /// + public static string NullObjectMessage + { + get + { + return ResourceManager.GetString("NullObjectMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to add a null RoleSettings to {0}. + /// + public static string NullRoleSettingsMessage + { + get + { + return ResourceManager.GetString("NullRoleSettingsMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to add new role to null service definition. + /// + public static string NullServiceDefinitionMessage + { + get + { + return ResourceManager.GetString("NullServiceDefinitionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request offer '{0}' is not found.. + /// + public static string OfferNotFoundMessage + { + get + { + return ResourceManager.GetString("OfferNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation "{0}" failed on VM with ID: {1}. + /// + public static string OperationFailedErrorMessage + { + get + { + return ResourceManager.GetString("OperationFailedErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The REST operation failed with message '{0}' and error code '{1}'. + /// + public static string OperationFailedMessage + { + get + { + return ResourceManager.GetString("OperationFailedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Job Id {0} did not complete within expected time or it is in Failed/Canceled/Invalid state.. + /// + public static string OperationTimedOutOrError + { + get + { + return ResourceManager.GetString("OperationTimedOutOrError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to package. + /// + public static string Package + { + get + { + return ResourceManager.GetString("Package", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Package is created at service root path {0}.. + /// + public static string PackageCreated + { + get + { + return ResourceManager.GetString("PackageCreated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {{ + /// "author": "", + /// + /// "name": "{0}", + /// "version": "0.0.0", + /// "dependencies":{{}}, + /// "devDependencies":{{}}, + /// "optionalDependencies": {{}}, + /// "engines": {{ + /// "node": "*", + /// "iisnode": "*" + /// }} + /// + ///}} + ///. + /// + public static string PackageJsonDefaultFile + { + get + { + return ResourceManager.GetString("PackageJsonDefaultFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to package.json. + /// + public static string PackageJsonFileName + { + get + { + return ResourceManager.GetString("PackageJsonFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path {0} doesn't exist.. + /// + public static string PathDoesNotExist + { + get + { + return ResourceManager.GetString("PathDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path for {0} doesn't exist in {1}.. + /// + public static string PathDoesNotExistForElement + { + get + { + return ResourceManager.GetString("PathDoesNotExistForElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the Peer Asn has to be provided.. + /// + public static string PeerAsnRequired + { + get + { + return ResourceManager.GetString("PeerAsnRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 5.4.0. + /// + public static string PHPDefaultRuntimeVersion + { + get + { + return ResourceManager.GetString("PHPDefaultRuntimeVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to php. + /// + public static string PhpRuntimeValue + { + get + { + return ResourceManager.GetString("PhpRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\PHP. + /// + public static string PHPScaffolding + { + get + { + return ResourceManager.GetString("PHPScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.PHP. + /// + public static string PHPScaffoldingResources + { + get + { + return ResourceManager.GetString("PHPScaffoldingResources", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing PHP version {0} for Role '{1}' (the PHP version locally installed is: {2}). + /// + public static string PHPVersionWarningText + { + get + { + return ResourceManager.GetString("PHPVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must create your first web site using the Microsoft Azure portal. + ///Please follow these steps in the portal: + ///1. At the bottom of the page, click on New > Web Site > Quick Create + ///2. Type {0} in the URL field + ///3. Click on "Create Web Site" + ///4. Once the site has been created, click on the site name + ///5. Click on "Set up Git publishing" or "Reset deployment credentials" and setup a publishing username and password. Use those credentials for all new websites you create.. + /// + public static string PortalInstructions + { + get + { + return ResourceManager.GetString("PortalInstructions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 6. Back in the console window, rerun this command by typing "New-AzureWebsite <site name> -Git". + /// + public static string PortalInstructionsGit + { + get + { + return ResourceManager.GetString("PortalInstructionsGit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The estimated generally available date is '{0}'.. + /// + public static string PreviewCmdletETAMessage { + get { + return ResourceManager.GetString("PreviewCmdletETAMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This cmdlet is in preview. Its behavior is subject to change based on customer feedback.. + /// + public static string PreviewCmdletMessage + { + get + { + return ResourceManager.GetString("PreviewCmdletMessage", resourceCulture); + } + } + + + /// + /// Looks up a localized string similar to A value for the Primary Peer Subnet has to be provided.. + /// + public static string PrimaryPeerSubnetRequired + { + get + { + return ResourceManager.GetString("PrimaryPeerSubnetRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Promotion code can be used only when updating to a new plan.. + /// + public static string PromotionCodeWithCurrentPlanMessage + { + get + { + return ResourceManager.GetString("PromotionCodeWithCurrentPlanMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service not published at user request.. + /// + public static string PublishAbortedAtUserRequest + { + get + { + return ResourceManager.GetString("PublishAbortedAtUserRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complete.. + /// + public static string PublishCompleteMessage + { + get + { + return ResourceManager.GetString("PublishCompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Connecting.... + /// + public static string PublishConnectingMessage + { + get + { + return ResourceManager.GetString("PublishConnectingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created Deployment ID: {0}.. + /// + public static string PublishCreatedDeploymentMessage + { + get + { + return ResourceManager.GetString("PublishCreatedDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created hosted service '{0}'.. + /// + public static string PublishCreatedServiceMessage + { + get + { + return ResourceManager.GetString("PublishCreatedServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created Website URL: {0}.. + /// + public static string PublishCreatedWebsiteMessage + { + get + { + return ResourceManager.GetString("PublishCreatedWebsiteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating.... + /// + public static string PublishCreatingServiceMessage + { + get + { + return ResourceManager.GetString("PublishCreatingServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Initializing.... + /// + public static string PublishInitializingMessage + { + get + { + return ResourceManager.GetString("PublishInitializingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to busy. + /// + public static string PublishInstanceStatusBusy + { + get + { + return ResourceManager.GetString("PublishInstanceStatusBusy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to creating the virtual machine. + /// + public static string PublishInstanceStatusCreating + { + get + { + return ResourceManager.GetString("PublishInstanceStatusCreating", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Instance {0} of role {1} is {2}.. + /// + public static string PublishInstanceStatusMessage + { + get + { + return ResourceManager.GetString("PublishInstanceStatusMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ready. + /// + public static string PublishInstanceStatusReady + { + get + { + return ResourceManager.GetString("PublishInstanceStatusReady", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing deployment for {0} with Subscription ID: {1}.... + /// + public static string PublishPreparingDeploymentMessage + { + get + { + return ResourceManager.GetString("PublishPreparingDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Publishing {0} to Microsoft Azure. This may take several minutes.... + /// + public static string PublishServiceStartMessage + { + get + { + return ResourceManager.GetString("PublishServiceStartMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to publish settings. + /// + public static string PublishSettings + { + get + { + return ResourceManager.GetString("PublishSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure. + /// + public static string PublishSettingsElementName + { + get + { + return ResourceManager.GetString("PublishSettingsElementName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to .PublishSettings. + /// + public static string PublishSettingsFileExtention + { + get + { + return ResourceManager.GetString("PublishSettingsFileExtention", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to publishSettings.xml. + /// + public static string PublishSettingsFileName + { + get + { + return ResourceManager.GetString("PublishSettingsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &whr={0}. + /// + public static string PublishSettingsFileRealmFormat + { + get + { + return ResourceManager.GetString("PublishSettingsFileRealmFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Publish settings imported. + /// + public static string PublishSettingsSetSuccessfully + { + get + { + return ResourceManager.GetString("PublishSettingsSetSuccessfully", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_PUBLISHINGPROFILE_URL. + /// + public static string PublishSettingsUrlEnv + { + get + { + return ResourceManager.GetString("PublishSettingsUrlEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting.... + /// + public static string PublishStartingMessage + { + get + { + return ResourceManager.GetString("PublishStartingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Upgrading.... + /// + public static string PublishUpgradingMessage + { + get + { + return ResourceManager.GetString("PublishUpgradingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Uploading Package to storage service {0}.... + /// + public static string PublishUploadingPackageMessage + { + get + { + return ResourceManager.GetString("PublishUploadingPackageMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Verifying storage account '{0}'.... + /// + public static string PublishVerifyingStorageMessage + { + get + { + return ResourceManager.GetString("PublishVerifyingStorageMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path '{0}' not found.. + /// + public static string PublishVMDscExtensionAdditionalContentPathNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionAdditionalContentPathNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration published to {0}. + /// + public static string PublishVMDscExtensionArchiveUploadedMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionArchiveUploadedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy '{0}' to '{1}'.. + /// + public static string PublishVMDscExtensionCopyFileVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCopyFileVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy the module '{0}' to '{1}'.. + /// + public static string PublishVMDscExtensionCopyModuleVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCopyModuleVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid configuration file: {0}. + ///The file needs to be a PowerShell script (.ps1 or .psm1).. + /// + public static string PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleted '{0}'. + /// + public static string PublishVMDscExtensionDeletedFileMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDeletedFileMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot delete '{0}': {1}. + /// + public static string PublishVMDscExtensionDeleteErrorMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDeleteErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path '{0}' not found.. + /// + public static string PublishVMDscExtensionDirectoryNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDirectoryNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot get module for DscResource '{0}'. Possible solutions: + ///1) Specify -ModuleName for Import-DscResource in your configuration. + ///2) Unblock module that contains resource. + ///3) Move Import-DscResource inside Node block. + ///. + /// + public static string PublishVMDscExtensionGetDscResourceFailed + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionGetDscResourceFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to List of required modules: [{0}].. + /// + public static string PublishVMDscExtensionRequiredModulesVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionRequiredModulesVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your current PowerShell version {1} is less then required by this cmdlet {0}. Consider download and install latest PowerShell version.. + /// + public static string PublishVMDscExtensionRequiredPsVersion + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionRequiredPsVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration script '{0}' contained parse errors: + ///{1}. + /// + public static string PublishVMDscExtensionStorageParserErrors + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionStorageParserErrors", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Temp folder '{0}' created.. + /// + public static string PublishVMDscExtensionTempFolderVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionTempFolderVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid configuration file: {0}. + ///The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip).. + /// + public static string PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration file '{0}' not found.. + /// + public static string PublishVMDscExtensionUploadArchiveConfigFileNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionUploadArchiveConfigFileNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure PowerShell collects usage data in order to improve your experience. + ///The data is anonymous and does not include commandline argument values. + ///The data is collected by Microsoft. + /// + ///Use the Disable-AzureDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Azure module. To disable data collection: PS > Disable-AzureDataCollection. + ///Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Azure module. To enable data collection: PS > Enab [rest of string was truncated]";. + /// + public static string RDFEDataCollectionMessage + { + get + { + return ResourceManager.GetString("RDFEDataCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Replace current deployment with '{0}' Id ?. + /// + public static string RedeployCommit + { + get + { + return ResourceManager.GetString("RedeployCommit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to regenerate key?. + /// + public static string RegenerateKeyWarning + { + get + { + return ResourceManager.GetString("RegenerateKeyWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Generate new key.. + /// + public static string RegenerateKeyWhatIfMessage + { + get + { + return ResourceManager.GetString("RegenerateKeyWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove account '{0}'?. + /// + public static string RemoveAccountConfirmation + { + get + { + return ResourceManager.GetString("RemoveAccountConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing account. + /// + public static string RemoveAccountMessage + { + get + { + return ResourceManager.GetString("RemoveAccountMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove Add-On Confirmation. + /// + public static string RemoveAddOnConformation + { + get + { + return ResourceManager.GetString("RemoveAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If you delete this add-on, your data may be deleted and the operation may not be undone. You may have to purchase it again from the Microsoft Azure Store to use it. The price of the add-on may not be refunded. Are you sure you want to delete this add-on? Enter “Yes” to confirm.. + /// + public static string RemoveAddOnMessage + { + get + { + return ResourceManager.GetString("RemoveAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureBGPPeering Operation failed.. + /// + public static string RemoveAzureBGPPeeringFailed + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Bgp Peering. + /// + public static string RemoveAzureBGPPeeringMessage + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Bgp Peering with Service Key {0}.. + /// + public static string RemoveAzureBGPPeeringSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Bgp Peering with service key '{0}'?. + /// + public static string RemoveAzureBGPPeeringWarning + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Dedicated Circuit with service key '{0}'?. + /// + public static string RemoveAzureDedicatdCircuitWarning + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatdCircuitWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureDedicatedCircuit Operation failed.. + /// + public static string RemoveAzureDedicatedCircuitFailed + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureDedicatedCircuitLink Operation failed.. + /// + public static string RemoveAzureDedicatedCircuitLinkFailed + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Dedicated Circui Link. + /// + public static string RemoveAzureDedicatedCircuitLinkMessage + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Dedicated Circuit Link with Service Key {0} and Vnet Name {1}. + /// + public static string RemoveAzureDedicatedCircuitLinkSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Dedicated Circuit Link with service key '{0}' and virtual network name '{1}'?. + /// + public static string RemoveAzureDedicatedCircuitLinkWarning + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Dedicated Circuit. + /// + public static string RemoveAzureDedicatedCircuitMessage + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Dedicated Circuit with Service Key {0}.. + /// + public static string RemoveAzureDedicatedCircuitSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing cloud service {0}.... + /// + public static string RemoveAzureServiceWaitMessage + { + get + { + return ResourceManager.GetString("RemoveAzureServiceWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription.. + /// + public static string RemoveDefaultSubscription + { + get + { + return ResourceManager.GetString("RemoveDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing {0} deployment for {1} service. + /// + public static string RemoveDeploymentWaitMessage + { + get + { + return ResourceManager.GetString("RemoveDeploymentWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing an environment will remove all associated subscriptions and accounts. Are you sure you want to remove an environment '{0}'?. + /// + public static string RemoveEnvironmentConfirmation + { + get + { + return ResourceManager.GetString("RemoveEnvironmentConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing environment. + /// + public static string RemoveEnvironmentMessage + { + get + { + return ResourceManager.GetString("RemoveEnvironmentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing job collection. + /// + public static string RemoveJobCollectionMessage + { + get + { + return ResourceManager.GetString("RemoveJobCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the job collection "{0}". + /// + public static string RemoveJobCollectionWarning + { + get + { + return ResourceManager.GetString("RemoveJobCollectionWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing job. + /// + public static string RemoveJobMessage + { + get + { + return ResourceManager.GetString("RemoveJobMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the job "{0}". + /// + public static string RemoveJobWarning + { + get + { + return ResourceManager.GetString("RemoveJobWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the account?. + /// + public static string RemoveMediaAccountWarning + { + get + { + return ResourceManager.GetString("RemoveMediaAccountWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account removed.. + /// + public static string RemoveMediaAccountWhatIfMessage + { + get + { + return ResourceManager.GetString("RemoveMediaAccountWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen because the namespace does not exist or it does not exist under your subscription.. + /// + public static string RemoveNamespaceErrorMessage + { + get + { + return ResourceManager.GetString("RemoveNamespaceErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing old package {0}.... + /// + public static string RemovePackage + { + get + { + return ResourceManager.GetString("RemovePackage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing the Azure profile will remove all associated environments, subscriptions, and accounts. Are you sure you want to remove the Azure profile?. + /// + public static string RemoveProfileConfirmation + { + get + { + return ResourceManager.GetString("RemoveProfileConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing the Azure profile. + /// + public static string RemoveProfileMessage + { + get + { + return ResourceManager.GetString("RemoveProfileMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete the namespace '{0}'?. + /// + public static string RemoveServiceBusNamespaceConfirmation + { + get + { + return ResourceManager.GetString("RemoveServiceBusNamespaceConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove cloud service?. + /// + public static string RemoveServiceWarning + { + get + { + return ResourceManager.GetString("RemoveServiceWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove cloud service and all it's deployments. + /// + public static string RemoveServiceWhatIfMessage + { + get + { + return ResourceManager.GetString("RemoveServiceWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove subscription '{0}'?. + /// + public static string RemoveSubscriptionConfirmation + { + get + { + return ResourceManager.GetString("RemoveSubscriptionConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing subscription. + /// + public static string RemoveSubscriptionMessage + { + get + { + return ResourceManager.GetString("RemoveSubscriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The endpoint {0} cannot be removed from profile {1} because it's not in the profile.. + /// + public static string RemoveTrafficManagerEndpointMissing + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerEndpointMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureTrafficManagerProfile Operation failed.. + /// + public static string RemoveTrafficManagerProfileFailed + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Traffic Manager profile with name {0}.. + /// + public static string RemoveTrafficManagerProfileSucceeded + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Traffic Manager profile "{0}"?. + /// + public static string RemoveTrafficManagerProfileWarning + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete the VM '{0}'?. + /// + public static string RemoveVMConfirmationMessage + { + get + { + return ResourceManager.GetString("RemoveVMConfirmationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleting VM.. + /// + public static string RemoveVMMessage + { + get + { + return ResourceManager.GetString("RemoveVMMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing WebJob.... + /// + public static string RemoveWebJobMessage + { + get + { + return ResourceManager.GetString("RemoveWebJobMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove job '{0}'?. + /// + public static string RemoveWebJobWarning + { + get + { + return ResourceManager.GetString("RemoveWebJobWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing website. + /// + public static string RemoveWebsiteMessage + { + get + { + return ResourceManager.GetString("RemoveWebsiteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the website "{0}". + /// + public static string RemoveWebsiteWarning + { + get + { + return ResourceManager.GetString("RemoveWebsiteWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing public environment is not supported.. + /// + public static string RemovingDefaultEnvironmentsNotSupported + { + get + { + return ResourceManager.GetString("RemovingDefaultEnvironmentsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleting namespace. + /// + public static string RemovingNamespaceMessage + { + get + { + return ResourceManager.GetString("RemovingNamespaceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Repository is not setup. You need to pass a valid site name.. + /// + public static string RepositoryNotSetup + { + get + { + return ResourceManager.GetString("RepositoryNotSetup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reserved IP with the Name:'{0}' will no longer be in use after the deployment is deleted, and it is still reserved for later use.. + /// + public static string ReservedIPNameNoLongerInUseButStillBeingReserved + { + get + { + return ResourceManager.GetString("ReservedIPNameNoLongerInUseButStillBeingReserved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resource with ID : {0} does not exist.. + /// + public static string ResourceNotFound + { + get + { + return ResourceManager.GetString("ResourceNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Restart. + /// + public static string Restart + { + get + { + return ResourceManager.GetString("Restart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resume. + /// + public static string Resume + { + get + { + return ResourceManager.GetString("Resume", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /role:{0};"{1}/{0}" . + /// + public static string RoleArgTemplate + { + get + { + return ResourceManager.GetString("RoleArgTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to bin. + /// + public static string RoleBinFolderName + { + get + { + return ResourceManager.GetString("RoleBinFolderName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} is {1}. + /// + public static string RoleInstanceWaitMsg + { + get + { + return ResourceManager.GetString("RoleInstanceWaitMsg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 20. + /// + public static string RoleMaxInstances + { + get + { + return ResourceManager.GetString("RoleMaxInstances", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to role name. + /// + public static string RoleName + { + get + { + return ResourceManager.GetString("RoleName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided role name {0} doesn't exist. + /// + public static string RoleNotFoundMessage + { + get + { + return ResourceManager.GetString("RoleNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RoleSettings.xml. + /// + public static string RoleSettingsTemplateFileName + { + get + { + return ResourceManager.GetString("RoleSettingsTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role type {0} doesn't exist. + /// + public static string RoleTypeDoesNotExist + { + get + { + return ResourceManager.GetString("RoleTypeDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to public static Dictionary<string, Location> ReverseLocations { get; private set; }. + /// + public static string RuntimeDeploymentLocationError + { + get + { + return ResourceManager.GetString("RuntimeDeploymentLocationError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing runtime deployment for service '{0}'. + /// + public static string RuntimeDeploymentStart + { + get + { + return ResourceManager.GetString("RuntimeDeploymentStart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WARNING Runtime Mismatch: Are you sure that you want to publish service '{0}' using an Azure runtime version that does not match your local runtime version?. + /// + public static string RuntimeMismatchWarning + { + get + { + return ResourceManager.GetString("RuntimeMismatchWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEOVERRIDEURL. + /// + public static string RuntimeOverrideKey + { + get + { + return ResourceManager.GetString("RuntimeOverrideKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /runtimemanifest/runtimes/runtime. + /// + public static string RuntimeQuery + { + get + { + return ResourceManager.GetString("RuntimeQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEID. + /// + public static string RuntimeTypeKey + { + get + { + return ResourceManager.GetString("RuntimeTypeKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEURL. + /// + public static string RuntimeUrlKey + { + get + { + return ResourceManager.GetString("RuntimeUrlKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEVERSIONPRIMARYKEY. + /// + public static string RuntimeVersionPrimaryKey + { + get + { + return ResourceManager.GetString("RuntimeVersionPrimaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to scaffold.xml. + /// + public static string ScaffoldXml + { + get + { + return ResourceManager.GetString("ScaffoldXml", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid location entered. Pick one of the locations from Get-AzureSchedulerLocation. + /// + public static string SchedulerInvalidLocation + { + get + { + return ResourceManager.GetString("SchedulerInvalidLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the Secondary Peer Subnet has to be provided.. + /// + public static string SecondaryPeerSubnetRequired + { + get + { + return ResourceManager.GetString("SecondaryPeerSubnetRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} already exists on disk in location {1}. + /// + public static string ServiceAlreadyExistsOnDisk + { + get + { + return ResourceManager.GetString("ServiceAlreadyExistsOnDisk", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No ServiceBus authorization rule with the given characteristics was found. + /// + public static string ServiceBusAuthorizationRuleNotFound + { + get + { + return ResourceManager.GetString("ServiceBusAuthorizationRuleNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The service bus entity '{0}' is not found.. + /// + public static string ServiceBusEntityTypeNotFound + { + get + { + return ResourceManager.GetString("ServiceBusEntityTypeNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen due to an incorrect/missing namespace. + /// + public static string ServiceBusNamespaceMissingMessage + { + get + { + return ResourceManager.GetString("ServiceBusNamespaceMissingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service configuration. + /// + public static string ServiceConfiguration + { + get + { + return ResourceManager.GetString("ServiceConfiguration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service definition. + /// + public static string ServiceDefinition + { + get + { + return ResourceManager.GetString("ServiceDefinition", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceDefinition.csdef. + /// + public static string ServiceDefinitionFileName + { + get + { + return ResourceManager.GetString("ServiceDefinitionFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}Deploy. + /// + public static string ServiceDeploymentName + { + get + { + return ResourceManager.GetString("ServiceDeploymentName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified cloud service "{0}" does not exist.. + /// + public static string ServiceDoesNotExist + { + get + { + return ResourceManager.GetString("ServiceDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} slot for service {1} is in {2} state, please wait until it finish and update it's status. + /// + public static string ServiceIsInTransitionState + { + get + { + return ResourceManager.GetString("ServiceIsInTransitionState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}.". + /// + public static string ServiceManagementClientExceptionStringFormat + { + get + { + return ResourceManager.GetString("ServiceManagementClientExceptionStringFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Begin Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionBeginOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionBeginOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Completed Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionCompletedOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionCompletedOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Begin Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionInOCSBeginOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionInOCSBeginOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Completed Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionInOCSCompletedOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionInOCSCompletedOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service name. + /// + public static string ServiceName + { + get + { + return ResourceManager.GetString("ServiceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided service name {0} already exists, please pick another name. + /// + public static string ServiceNameExists + { + get + { + return ResourceManager.GetString("ServiceNameExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide name for the hosted service. + /// + public static string ServiceNameMissingMessage + { + get + { + return ResourceManager.GetString("ServiceNameMissingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service parent directory. + /// + public static string ServiceParentDirectory + { + get + { + return ResourceManager.GetString("ServiceParentDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} removed successfully. + /// + public static string ServiceRemovedMessage + { + get + { + return ResourceManager.GetString("ServiceRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service directory. + /// + public static string ServiceRoot + { + get + { + return ResourceManager.GetString("ServiceRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service settings. + /// + public static string ServiceSettings + { + get + { + return ResourceManager.GetString("ServiceSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.. + /// + public static string ServiceSettings_ValidateStorageAccountName_InvalidName + { + get + { + return ResourceManager.GetString("ServiceSettings_ValidateStorageAccountName_InvalidName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} slot for cloud service {1} doesn't exist.. + /// + public static string ServiceSlotDoesNotExist + { + get + { + return ResourceManager.GetString("ServiceSlotDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} slot for service {1} is {2}. + /// + public static string ServiceStatusChanged + { + get + { + return ResourceManager.GetString("ServiceStatusChanged", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Set Add-On Confirmation. + /// + public static string SetAddOnConformation + { + get + { + return ResourceManager.GetString("SetAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Profile {0} does not contain endpoint {1}. Adding it.. + /// + public static string SetInexistentTrafficManagerEndpointMessage + { + get + { + return ResourceManager.GetString("SetInexistentTrafficManagerEndpointMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note - You will be charged the amount for the new plan, without being refunded for time remaining + ///in the existing plan. + ///By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my + ///contact information with {2}.. + /// + public static string SetMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("SetMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note - You will be charged the amount for the new plan, without being refunded for time remaining + ///in the existing plan. + ///By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of + ///use and privacy statement at <url> and (c) agree to sharing my contact information with {2}.. + /// + public static string SetNonMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("SetNonMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} instances are set to {1}. + /// + public static string SetRoleInstancesMessage + { + get + { + return ResourceManager.GetString("SetRoleInstancesMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {"Slot":"","Location":"","Subscription":"","StorageAccountName":""}. + /// + public static string SettingsFileEmptyContent + { + get + { + return ResourceManager.GetString("SettingsFileEmptyContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to deploymentSettings.json. + /// + public static string SettingsFileName + { + get + { + return ResourceManager.GetString("SettingsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insufficient parameters passed to create a new endpoint.. + /// + public static string SetTrafficManagerEndpointNeedsParameters + { + get + { + return ResourceManager.GetString("SetTrafficManagerEndpointNeedsParameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ambiguous operation: the profile name specified doesn't match the name of the profile object.. + /// + public static string SetTrafficManagerProfileAmbiguous + { + get + { + return ResourceManager.GetString("SetTrafficManagerProfileAmbiguous", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and include the 'Force' parameter, if available, to avoid unnecessary prompts.. + /// + public static string ShouldContinueFail + { + get + { + return ResourceManager.GetString("ShouldContinueFail", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Confirm. + /// + public static string ShouldProcessCaption + { + get + { + return ResourceManager.GetString("ShouldProcessCaption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and omit the 'Confirm' parameter when using the 'AsJob' parameter.. + /// + public static string ShouldProcessFailConfirm + { + get + { + return ResourceManager.GetString("ShouldProcessFailConfirm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please increase the user $ConfirmPreference setting, or include turn off confirmation using '-Confirm:$false' when using the 'AsJob' parameter and execute the cmdet again.. + /// + public static string ShouldProcessFailImpact + { + get + { + return ResourceManager.GetString("ShouldProcessFailImpact", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and omit the 'WhatIf' parameter when using the 'AsJob' parameter.. + /// + public static string ShouldProcessFailWhatIf + { + get + { + return ResourceManager.GetString("ShouldProcessFailWhatIf", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shutdown. + /// + public static string Shutdown + { + get + { + return ResourceManager.GetString("Shutdown", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /sites:{0};{1};"{2}/{0}" . + /// + public static string SitesArgTemplate + { + get + { + return ResourceManager.GetString("SitesArgTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1000. + /// + public static string StandardRetryDelayInMs + { + get + { + return ResourceManager.GetString("StandardRetryDelayInMs", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start. + /// + public static string Start + { + get + { + return ResourceManager.GetString("Start", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Started. + /// + public static string StartedEmulator + { + get + { + return ResourceManager.GetString("StartedEmulator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting Emulator.... + /// + public static string StartingEmulator + { + get + { + return ResourceManager.GetString("StartingEmulator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to start. + /// + public static string StartStorageEmulatorCommandArgument + { + get + { + return ResourceManager.GetString("StartStorageEmulatorCommandArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stop. + /// + public static string Stop + { + get + { + return ResourceManager.GetString("Stop", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopping emulator.... + /// + public static string StopEmulatorMessage + { + get + { + return ResourceManager.GetString("StopEmulatorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopped. + /// + public static string StoppedEmulatorMessage + { + get + { + return ResourceManager.GetString("StoppedEmulatorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to stop. + /// + public static string StopStorageEmulatorCommandArgument + { + get + { + return ResourceManager.GetString("StopStorageEmulatorCommandArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account Name:. + /// + public static string StorageAccountName + { + get + { + return ResourceManager.GetString("StorageAccountName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find storage account '{0}' please type the name of an existing storage account.. + /// + public static string StorageAccountNotFound + { + get + { + return ResourceManager.GetString("StorageAccountNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AzureStorageEmulator.exe. + /// + public static string StorageEmulatorExe + { + get + { + return ResourceManager.GetString("StorageEmulatorExe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to InstallPath. + /// + public static string StorageEmulatorInstallPathRegistryKeyValue + { + get + { + return ResourceManager.GetString("StorageEmulatorInstallPathRegistryKeyValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SOFTWARE\Microsoft\Windows Azure Storage Emulator. + /// + public static string StorageEmulatorRegistryKey + { + get + { + return ResourceManager.GetString("StorageEmulatorRegistryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Primary Key:. + /// + public static string StoragePrimaryKey + { + get + { + return ResourceManager.GetString("StoragePrimaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Secondary Key:. + /// + public static string StorageSecondaryKey + { + get + { + return ResourceManager.GetString("StorageSecondaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named {0} already exists.. + /// + public static string SubscriptionAlreadyExists + { + get + { + return ResourceManager.GetString("SubscriptionAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information.. + /// + public static string SubscriptionDataFileDeprecated + { + get + { + return ResourceManager.GetString("SubscriptionDataFileDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DefaultSubscriptionData.xml. + /// + public static string SubscriptionDataFileName + { + get + { + return ResourceManager.GetString("SubscriptionDataFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription data file {0} does not exist.. + /// + public static string SubscriptionDataFileNotFound + { + get + { + return ResourceManager.GetString("SubscriptionDataFileNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription id {0} doesn't exist.. + /// + public static string SubscriptionIdNotFoundMessage + { + get + { + return ResourceManager.GetString("SubscriptionIdNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription must not be null. + /// + public static string SubscriptionMustNotBeNull + { + get + { + return ResourceManager.GetString("SubscriptionMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription name needs to be specified.. + /// + public static string SubscriptionNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("SubscriptionNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription name {0} doesn't exist.. + /// + public static string SubscriptionNameNotFoundMessage + { + get + { + return ResourceManager.GetString("SubscriptionNameNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription needs to be specified.. + /// + public static string SubscriptionNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("SubscriptionNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Suspend. + /// + public static string Suspend + { + get + { + return ResourceManager.GetString("Suspend", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Swapping website production slot .... + /// + public static string SwappingWebsite + { + get + { + return ResourceManager.GetString("SwappingWebsite", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to swap the website '{0}' production slot with slot '{1}'?. + /// + public static string SwapWebsiteSlotWarning + { + get + { + return ResourceManager.GetString("SwapWebsiteSlotWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Switch-AzureMode cmdlet is deprecated and will be removed in a future release.. + /// + public static string SwitchAzureModeDeprecated + { + get + { + return ResourceManager.GetString("SwitchAzureModeDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Starting cmdlet execution, setting for cmdlet confirmation required: '{0}'. + /// + public static string TraceBeginLROJob + { + get + { + return ResourceManager.GetString("TraceBeginLROJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Blocking job for ShouldMethod '{0}'. + /// + public static string TraceBlockLROThread + { + get + { + return ResourceManager.GetString("TraceBlockLROThread", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Completing cmdlet execution in RunJob. + /// + public static string TraceEndLROJob + { + get + { + return ResourceManager.GetString("TraceEndLROJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: State change from '{0}' to '{1}' because '{2}'. + /// + public static string TraceHandleLROStateChange + { + get + { + return ResourceManager.GetString("TraceHandleLROStateChange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Unblocking job due to stoppage or failure. + /// + public static string TraceHandlerCancelJob + { + get + { + return ResourceManager.GetString("TraceHandlerCancelJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Unblocking job that was previously blocked.. + /// + public static string TraceHandlerUnblockJob + { + get + { + return ResourceManager.GetString("TraceHandlerUnblockJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Error in cmdlet execution. + /// + public static string TraceLROJobException + { + get + { + return ResourceManager.GetString("TraceLROJobException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Removing state changed event handler, exception '{0}'. + /// + public static string TraceRemoveLROEventHandler + { + get + { + return ResourceManager.GetString("TraceRemoveLROEventHandler", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: ShouldMethod '{0}' unblocked.. + /// + public static string TraceUnblockLROThread + { + get + { + return ResourceManager.GetString("TraceUnblockLROThread", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}.. + /// + public static string UnableToDecodeBase64String + { + get + { + return ResourceManager.GetString("UnableToDecodeBase64String", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to update mismatching Json structured: {0} {1}.. + /// + public static string UnableToPatchJson + { + get + { + return ResourceManager.GetString("UnableToPatchJson", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provider {0} is unknown.. + /// + public static string UnknownProviderMessage + { + get + { + return ResourceManager.GetString("UnknownProviderMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update. + /// + public static string Update + { + get + { + return ResourceManager.GetString("Update", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updated settings for subscription '{0}'. Current subscription is '{1}'.. + /// + public static string UpdatedSettings + { + get + { + return ResourceManager.GetString("UpdatedSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User name is not valid.. + /// + public static string UserNameIsNotValid + { + get + { + return ResourceManager.GetString("UserNameIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User name needs to be specified.. + /// + public static string UserNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("UserNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the VLan Id has to be provided.. + /// + public static string VlanIdRequired + { + get + { + return ResourceManager.GetString("VlanIdRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please wait.... + /// + public static string WaitMessage + { + get + { + return ResourceManager.GetString("WaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The azure storage emulator is not installed, skip launching.... + /// + public static string WarningWhenStorageEmulatorIsMissing + { + get + { + return ResourceManager.GetString("WarningWhenStorageEmulatorIsMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Web.cloud.config. + /// + public static string WebCloudConfig + { + get + { + return ResourceManager.GetString("WebCloudConfig", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to web.config. + /// + public static string WebConfigTemplateFileName + { + get + { + return ResourceManager.GetString("WebConfigTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to MSDeploy. + /// + public static string WebDeployKeywordInWebSitePublishProfile + { + get + { + return ResourceManager.GetString("WebDeployKeywordInWebSitePublishProfile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot build the project successfully. Please see logs in {0}.. + /// + public static string WebProjectBuildFailTemplate + { + get + { + return ResourceManager.GetString("WebProjectBuildFailTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebRole. + /// + public static string WebRole + { + get + { + return ResourceManager.GetString("WebRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to setup_web.cmd > log.txt. + /// + public static string WebRoleStartupTaskCommandLine + { + get + { + return ResourceManager.GetString("WebRoleStartupTaskCommandLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebRole.xml. + /// + public static string WebRoleTemplateFileName + { + get + { + return ResourceManager.GetString("WebRoleTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebSite with given name {0} already exists in the specified Subscription and Webspace.. + /// + public static string WebsiteAlreadyExists + { + get + { + return ResourceManager.GetString("WebsiteAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebSite with given name {0} already exists in the specified Subscription and Location.. + /// + public static string WebsiteAlreadyExistsReplacement + { + get + { + return ResourceManager.GetString("WebsiteAlreadyExistsReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Site {0} already has repository created for it.. + /// + public static string WebsiteRepositoryAlreadyExists + { + get + { + return ResourceManager.GetString("WebsiteRepositoryAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Workspaces/WebsiteExtension/Website/{0}/dashboard/. + /// + public static string WebsiteSufixUrl + { + get + { + return ResourceManager.GetString("WebsiteSufixUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://{0}/msdeploy.axd?site={1}. + /// + public static string WebSiteWebDeployUriTemplate + { + get + { + return ResourceManager.GetString("WebSiteWebDeployUriTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WorkerRole. + /// + public static string WorkerRole + { + get + { + return ResourceManager.GetString("WorkerRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to setup_worker.cmd > log.txt. + /// + public static string WorkerRoleStartupTaskCommandLine + { + get + { + return ResourceManager.GetString("WorkerRoleStartupTaskCommandLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WorkerRole.xml. + /// + public static string WorkerRoleTemplateFileName + { + get + { + return ResourceManager.GetString("WorkerRoleTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to (x86). + /// + public static string x86InProgramFiles + { + get + { + return ResourceManager.GetString("x86InProgramFiles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes. + /// + public static string Yes + { + get + { + return ResourceManager.GetString("Yes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes, I agree. + /// + public static string YesHint + { + get + { + return ResourceManager.GetString("YesHint", resourceCulture); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Properties/Resources.resx b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Properties/Resources.resx new file mode 100644 index 000000000000..a08a2e50172b --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Properties/Resources.resx @@ -0,0 +1,1747 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The remote server returned an error: (401) Unauthorized. + + + Account "{0}" has been added. + + + To switch to a different subscription, please use Select-AzureSubscription. + + + Subscription "{0}" is selected as the default subscription. + + + To view all the subscriptions, please use Get-AzureSubscription. + + + Add-On {0} is created successfully. + + + Add-on name {0} is already used. + + + Add-On {0} not found. + + + Add-on {0} is removed successfully. + + + Add-On {0} is updated successfully. + + + Role has been created at {0}\{1}. + + + Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for Node.js by running ‘npm install azure’. + + + Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for PHP by running "pear WindowsAzure/WindowsAzure". + + + Unable to set role permissions. Please give the 'Network Service' user 'Read & execute' and 'Modify' permissions to the role folder, or run PowerShell as an Administrator + + + A role name '{0}' already exists + + + Windows Azure Powershell\ + + + https://manage.windowsazure.com + + + AZURE_PORTAL_URL + + + Azure SDK\{0}\ + + + Base Uri was empty. + WAPackIaaS + + + {0} begin processing without ParameterSet. + + + {0} begin processing with ParameterSet '{1}'. + + + Blob with the name {0} already exists in the account. + + + https://{0}.blob.core.windows.net/ + + + AZURE_BLOBSTORAGE_TEMPLATE + + + CACHERUNTIMEURL + + + cache + + + CacheRuntimeVersion + + + Installing caching version {0} for Role '{1}' (the caching version locally installed is: {2}) + + + Cannot find {0} with name {1}. + + + Deployment for service {0} with {1} slot doesn't exist + + + Can't find valid Microsoft Azure role in current directory {0} + + + service {0} configuration file (ServiceConfiguration.Cloud.cscfg) is either null or doesn't exist + + + Invalid service path! Cannot locate ServiceDefinition.csdef in current folder or parent folders. + + + The subscription named {0} with id {1} is not currently imported. You must import this subscription before it can be updated. + + + ManagementCertificate + + + certificate.pfx + + + Certificate imported into CurrentUser\My\{0} + + + Your account does not have access to the private key for certificate {0} + + + {0} {1} deployment for {2} service + + + Cloud service {0} is in {1} state. + + + Changing/Removing public environment '{0}' is not allowed. + + + Service {0} is set to value {1} + + + Choose which publish settings file to use: + + + Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel + + + 1 + + + cloud_package.cspkg + + + ServiceConfiguration.Cloud.cscfg + + + Add-ons for {0} + + + Communication could not be established. This could be due to an invalid subscription ID. Note that subscription IDs are case sensitive. + + + Complete + + + config.json + + + VirtualMachine creation failed. + WAPackIaaS + + + Creating the website failed. If this is the first website for this subscription, please create it using the management portal instead. + + + Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core + + + //blobcontainer[@datacenter='{0}'] + + + Setting: {0} as the default and current subscription. To view other subscriptions use Get-AzureSubscription + + + none + + + There are no hostnames which could be used for validation. + + + 8080 + + + 1000 + + + Auto + + + 80 + + + Delete + WAPackIaaS + + + The {0} slot for service {1} is already in {2} state + + + The deployment in {0} slot for service {1} is removed + + + Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel + + + 1 + + + The key to add already exists in the dictionary. + + + The array index cannot be less than zero. + + + The supplied array does not have enough room to contain the copied elements. + + + The provided dns {0} doesn't exist + + + Microsoft Azure Certificate + + + Endpoint can't be retrieved for storage account + + + {0} end processing. + + + To use Active Directory authentication, you must configure the ActiveDirectoryEndpoint, ActiveDirectoryTenantId, and ActiveDirectorServiceEndpointResourceId for environment of '{0}'. You can configure these properties for this environment using the Set-AzureEnvironment cmdlet. + + + The environment '{0}' already exists. + + + environments.xml + + + Error creating VirtualMachine + WAPackIaaS + + + Unable to download available runtimes for location '{0}' + + + Error updating VirtualMachine + WAPackIaaS + + + Job Id {0} failed. Error: {1}, ExceptionDetails: {2} + WAPackIaaS + + + The HTTP request was forbidden with client authentication scheme 'Anonymous'. + + + This add-on requires you to purchase the first instance through the Microsoft Azure Portal. Subsequent purchases can be performed through PowerShell. + + + Operation Status: + + + Resources\Scaffolding\General + + + Getting all available Microsoft Azure Add-Ons, this may take few minutes... + + + Name{0}Primary Key{0}Seconday Key + + + Git not found. Please install git and place it in your command line path. + + + Could not find publish settings. Please run Import-AzurePublishSettingsFile. + + + iisnode.dll + + + iisnode + + + iisnode-dev\\release\\x64 + + + iisnode + + + Installing IISNode version {0} in Azure for WebRole '{1}' (the version locally installed is: {2}) + + + Internal Server Error + + + Cannot enable memcach protocol on a cache worker role {0}. + + + Invalid certificate format. + + + The provided configuration path is invalid or doesn't exist + + + The country name is invalid, please use a valid two character country code, as described in ISO 3166-1 alpha-2. + + + Deployment with {0} does not exist + + + The deployment slot name {0} is invalid. Slot name must be either "Staging" or "Production". + + + Invalid service endpoint. + + + File {0} has invalid characters + + + You must create your git publishing credentials using the Microsoft Azure portal. +Please follow these steps in the portal: +1. On the left side open "Web Sites" +2. Click on any website +3. Choose "Setup Git Publishing" or "Reset deployment credentials" +4. Back in the PowerShell window, rerun this command by typing "New-AzureWebSite {site name} -Git -PublishingUsername {username} + + + The value {0} provided is not a valid GUID. Please provide a valid GUID. + + + The specified hostname does not exist. Please specify a valid hostname for the site. + + + Role {0} instances must be greater than or equal 0 and less than or equal 20 + + + There was an error creating your webjob. Please make sure that the script is in the root folder of the zip file. + + + Could not download a valid runtime manifest, Please check your internet connection and try again. + + + The account {0} was not found. Please specify a valid account name. + + + The provided name "{0}" does not match the service bus namespace naming rules. + + + Value cannot be null. Parameter name: '{0}' + + + The provided package path is invalid or doesn't exist + + + '{0}' is an invalid parameter set name. + + + {0} doesn't exist in {1} or you've not passed valid value for it + + + Path {0} has invalid characters + + + The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile + + + The provided role name "{0}" has invalid characters + + + A valid name for the service root folder is required + + + {0} is not a recognized runtime type + + + A valid language is required + + + No subscription is currently selected. Use Select-Subscription to activate a subscription. + + + The provided location "{0}" does not exist in the available locations use Get-AzureSBLocation for listing available locations. + + + Please provide a service name or run this command from inside a service project directory. + + + You must provide valid value for {0} + + + settings.json is invalid or doesn't exist + + + The subscription named '{0}' cannot be found. Use Set-AzureSubscription to initialize the subscription data. + + + The provided subscription id {0} is not valid + + + A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet + + + The provided subscriptions file {0} has invalid content. + + + Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge. + + + The web job file must have *.zip extension + + + Singleton option works for continuous jobs only. + + + The website {0} was not found. Please specify a valid website name. + + + No job for id: {0} was found. + WAPackIaaS + + + engines + + + Scaffolding for this language is not yet supported + + + Link already established + + + local_package.csx + + + ServiceConfiguration.Local.cscfg + + + Looking for {0} deployment for {1} cloud service... + + + Looking for cloud service {0}... + + + managementCertificate.pem + + + ?whr={0} + + + //baseuri + + + uri + + + http://az413943.vo.msecnd.net/node/runtimemanifest_0.7.5.2.xml + + + Multiple Add-Ons found holding name {0} + + + Multiple possible publishing users. Please go to the Portal and use the listed deployment user, or click 'set/reset deployment credentials' to set up a new user account, then reurn this cmdlet and specify PublishingUsername. + + + The first publish settings file "{0}" is used. If you want to use another file specify the file name. + + + Microsoft.WindowsAzure.Plugins.Caching.NamedCaches + + + {"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]} + + + A publishing username is required. Please specify one using the argument PublishingUsername. + + + New Add-On Confirmation + + + By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my +contact information with {2}. + + + Internal Server Error. This could happen because the namespace name is already used or due to an incorrect location name. Use Get-AzureSBLocation cmdlet to list valid names. + + + By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of +use and privacy statement at {0} and (c) agree to sharing my contact information with {2}. + + + Service has been created at {0} + + + No + + + There is no access token cached for subscription {0}, user id {1}. Use the Add-AzureAccount cmdlet to log in again and get a token for this subscription. + + + The service does not have any cache worker roles, add one first by running cmdlet Add-AzureCacheWorkerRole. + + + No clouds available + WAPackIaaS + + + nodejs + + + node + + + node.exe + + + There is no default subscription set, please set a default subscription by running Set-AzureSubscription -Default <subscription name> + + + Microsoft SDKs\Azure\Nodejs\Nov2011 + + + nodejs + + + node + + + Resources\Scaffolding\Node + + + Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.Node + + + Installing Node version {0} in Azure for Role '{1}' (the Node version locally installed is: {2}) + + + No, I do not agree + + + No publish settings files with extension *.publishsettings are found in the directory "{0}". + + + '{0}' must be a cache worker role. Verify that it has proper cache worker role configuration. + + + Certificate can't be null. + + + {0} could not be null or empty + + + Unable to add a null RoleSettings to {0} + + + Unable to add new role to null service definition + + + The request offer '{0}' is not found. + + + Operation "{0}" failed on VM with ID: {1} + WAPackIaaS + + + The REST operation failed with message '{0}' and error code '{1}' + + + Job Id {0} did not complete within expected time or it is in Failed/Canceled/Invalid state. + WAPackIaaS + + + package + + + Package is created at service root path {0}. + + + {{ + "author": "", + + "name": "{0}", + "version": "0.0.0", + "dependencies":{{}}, + "devDependencies":{{}}, + "optionalDependencies": {{}}, + "engines": {{ + "node": "*", + "iisnode": "*" + }} + +}} + + + + package.json + + + A value for the Peer Asn has to be provided. + + + 5.4.0 + + + php + + + Resources\Scaffolding\PHP + + + Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.PHP + + + Installing PHP version {0} for Role '{1}' (the PHP version locally installed is: {2}) + + + You must create your first web site using the Microsoft Azure portal. +Please follow these steps in the portal: +1. At the bottom of the page, click on New > Web Site > Quick Create +2. Type {0} in the URL field +3. Click on "Create Web Site" +4. Once the site has been created, click on the site name +5. Click on "Set up Git publishing" or "Reset deployment credentials" and setup a publishing username and password. Use those credentials for all new websites you create. + + + 6. Back in the console window, rerun this command by typing "New-AzureWebsite <site name> -Git" + + + A value for the Primary Peer Subnet has to be provided. + + + Promotion code can be used only when updating to a new plan. + + + Service not published at user request. + + + Complete. + + + Connecting... + + + Created Deployment ID: {0}. + + + Created hosted service '{0}'. + + + Created Website URL: {0}. + + + Creating... + + + Initializing... + + + busy + + + creating the virtual machine + + + Instance {0} of role {1} is {2}. + + + ready + + + Preparing deployment for {0} with Subscription ID: {1}... + + + Publishing {0} to Microsoft Azure. This may take several minutes... + + + publish settings + + + Azure + + + .PublishSettings + + + publishSettings.xml + + + Publish settings imported + + + AZURE_PUBLISHINGPROFILE_URL + + + Starting... + + + Upgrading... + + + Uploading Package to storage service {0}... + + + Verifying storage account '{0}'... + + + Replace current deployment with '{0}' Id ? + + + Are you sure you want to regenerate key? + + + Generate new key. + + + Are you sure you want to remove account '{0}'? + + + Removing account + + + Remove Add-On Confirmation + + + If you delete this add-on, your data may be deleted and the operation may not be undone. You may have to purchase it again from the Microsoft Azure Store to use it. The price of the add-on may not be refunded. Are you sure you want to delete this add-on? Enter “Yes” to confirm. + + + Remove-AzureBGPPeering Operation failed. + + + Removing Bgp Peering + + + Successfully removed Azure Bgp Peering with Service Key {0}. + + + Are you sure you want to remove the Bgp Peering with service key '{0}'? + + + Are you sure you want to remove the Dedicated Circuit with service key '{0}'? + + + Remove-AzureDedicatedCircuit Operation failed. + + + Remove-AzureDedicatedCircuitLink Operation failed. + + + Removing Dedicated Circui Link + + + Successfully removed Azure Dedicated Circuit Link with Service Key {0} and Vnet Name {1} + + + Are you sure you want to remove the Dedicated Circuit Link with service key '{0}' and virtual network name '{1}'? + + + Removing Dedicated Circuit + + + Successfully removed Azure Dedicated Circuit with Service Key {0}. + + + Removing cloud service {0}... + + + Removing {0} deployment for {1} service + + + Removing job collection + + + Are you sure you want to remove the job collection "{0}" + + + Removing job + + + Are you sure you want to remove the job "{0}" + + + Are you sure you want to remove the account? + + + Account removed. + + + Internal Server Error. This could happen because the namespace does not exist or it does not exist under your subscription. + + + Removing old package {0}... + + + Are you sure you want to delete the namespace '{0}'? + + + Are you sure you want to remove cloud service? + + + Remove cloud service and all it's deployments + + + Are you sure you want to remove subscription '{0}'? + + + Removing subscription + + + Are you sure you want to delete the VM '{0}'? + + + Deleting VM. + + + Removing WebJob... + + + Are you sure you want to remove job '{0}'? + + + Removing website + + + Are you sure you want to remove the website "{0}" + + + Deleting namespace + + + Repository is not setup. You need to pass a valid site name. + + + Reserved IP with the Name:'{0}' will no longer be in use after the deployment is deleted, and it is still reserved for later use. + + + Resource with ID : {0} does not exist. + WAPackIaaS + + + Restart + WAPackIaaS + + + Resume + WAPackIaaS + + + /role:{0};"{1}/{0}" + + + bin + + + Role {0} is {1} + + + 20 + + + role name + + + The provided role name {0} doesn't exist + + + RoleSettings.xml + + + Role type {0} doesn't exist + + + public static Dictionary<string, Location> ReverseLocations { get; private set; } + + + Preparing runtime deployment for service '{0}' + + + WARNING Runtime Mismatch: Are you sure that you want to publish service '{0}' using an Azure runtime version that does not match your local runtime version? + + + RUNTIMEOVERRIDEURL + + + /runtimemanifest/runtimes/runtime + + + RUNTIMEID + + + RUNTIMEURL + + + RUNTIMEVERSIONPRIMARYKEY + + + scaffold.xml + + + Invalid location entered. Pick one of the locations from Get-AzureSchedulerLocation + + + A value for the Secondary Peer Subnet has to be provided. + + + Service {0} already exists on disk in location {1} + + + No ServiceBus authorization rule with the given characteristics was found + + + The service bus entity '{0}' is not found. + + + Internal Server Error. This could happen due to an incorrect/missing namespace + + + service configuration + + + service definition + + + ServiceDefinition.csdef + + + {0}Deploy + + + The specified cloud service "{0}" does not exist. + + + {0} slot for service {1} is in {2} state, please wait until it finish and update it's status + + + Begin Operation: {0} + + + Completed Operation: {0} + + + Begin Operation: {0} + + + Completed Operation: {0} + + + service name + + + Please provide name for the hosted service + + + service parent directory + + + Service {0} removed successfully + + + service directory + + + service settings + + + The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + + + The {0} slot for cloud service {1} doesn't exist. + + + {0} slot for service {1} is {2} + + + Set Add-On Confirmation + + + Note - You will be charged the amount for the new plan, without being refunded for time remaining +in the existing plan. +By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my +contact information with {2}. + + + Note - You will be charged the amount for the new plan, without being refunded for time remaining +in the existing plan. +By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of +use and privacy statement at <url> and (c) agree to sharing my contact information with {2}. + + + Role {0} instances are set to {1} + + + {"Slot":"","Location":"","Subscription":"","StorageAccountName":""} + + + deploymentSettings.json + + + Confirm + + + Shutdown + WAPackIaaS + + + /sites:{0};{1};"{2}/{0}" + + + 1000 + + + Start + WAPackIaaS + + + Started + + + Starting Emulator... + + + start + + + Stop + WAPackIaaS + + + Stopping emulator... + + + Stopped + + + stop + + + Account Name: + + + Cannot find storage account '{0}' please type the name of an existing storage account. + + + AzureStorageEmulator.exe + + + InstallPath + + + SOFTWARE\Microsoft\Windows Azure Storage Emulator + + + Primary Key: + + + Secondary Key: + + + The subscription named {0} already exists. + + + DefaultSubscriptionData.xml + + + The subscription data file {0} does not exist. + + + Subscription must not be null + WAPackIaaS + + + Suspend + WAPackIaaS + + + Swapping website production slot ... + + + Are you sure you want to swap the website '{0}' production slot with slot '{1}'? + + + The provider {0} is unknown. + + + Update + WAPackIaaS + + + Updated settings for subscription '{0}'. Current subscription is '{1}'. + + + A value for the VLan Id has to be provided. + + + Please wait... + + + The azure storage emulator is not installed, skip launching... + + + Web.cloud.config + + + web.config + + + MSDeploy + + + Cannot build the project successfully. Please see logs in {0}. + + + WebRole + + + setup_web.cmd > log.txt + + + WebRole.xml + + + WebSite with given name {0} already exists in the specified Subscription and Webspace. + + + WebSite with given name {0} already exists in the specified Subscription and Location. + + + Site {0} already has repository created for it. + + + Workspaces/WebsiteExtension/Website/{0}/dashboard/ + + + https://{0}/msdeploy.axd?site={1} + + + WorkerRole + + + setup_worker.cmd > log.txt + + + WorkerRole.xml + + + Yes + + + Yes, I agree + + + Remove-AzureTrafficManagerProfile Operation failed. + + + Successfully removed Traffic Manager profile with name {0}. + + + Are you sure you want to remove the Traffic Manager profile "{0}"? + + + Profile {0} already has an endpoint with name {1} + + + Profile {0} does not contain endpoint {1}. Adding it. + + + The endpoint {0} cannot be removed from profile {1} because it's not in the profile. + + + Insufficient parameters passed to create a new endpoint. + + + Ambiguous operation: the profile name specified doesn't match the name of the profile object. + + + <NONE> + + + "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}." + {0} is the HTTP status code. {1} is the Service Management Error Code. {2} is the Service Management Error message. {3} is the operation tracking ID. + + + Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}. + {0} is the string that is not in a valid base 64 format. + + + Skipping external tenant {0}, because you are using a guest or a foreign principal object identity. In order to access this tenant, please run Add-AzureAccount without "-Credential". + + + Removing an environment will remove all associated subscriptions and accounts. Are you sure you want to remove an environment '{0}'? + + + Removing environment + + + There is no subscription associated with account {0}. + + + Account id doesn't match one in subscription. + + + Environment name doesn't match one in subscription. + + + Removing the Azure profile will remove all associated environments, subscriptions, and accounts. Are you sure you want to remove the Azure profile? + + + Removing the Azure profile + + + The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. + + + Account needs to be specified + + + No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription. + + + Path must specify a valid path to an Azure profile. + + + Property bag Hashtable must contain one of the following sets of properties: {SubscriptionId, Certificate}, {SubscriptionId, Username, Password}, {SubscriptionId, ServicePrincipal, Password, Tenant}, {SubscriptionId, AccountId, Token} + + + Property bag Hashtable must contain a 'Certificate' of type 'X509Certificate2'. + + + Property bag Hashtable must contain a 'Password' with an associated 'Username' or 'ServicePrincipal'. + + + Property bag Hashtable must contain a 'SubscriptionId'. + + + Selected profile must not be null. + + + The Switch-AzureMode cmdlet is deprecated and will be removed in a future release. + + + OperationID : '{0}' + + + Cannot get module for DscResource '{0}'. Possible solutions: +1) Specify -ModuleName for Import-DscResource in your configuration. +2) Unblock module that contains resource. +3) Move Import-DscResource inside Node block. + + 0 = name of DscResource + + + Your current PowerShell version {1} is less then required by this cmdlet {0}. Consider download and install latest PowerShell version. + {0} = minimal required PS version, {1} = current PS version + + + Parsing configuration script: {0} + {0} is the path to a script file + + + Configuration script '{0}' contained parse errors: +{1} + 0 = path to the configuration script, 1 = parser errors + + + List of required modules: [{0}]. + {0} = list of modules + + + Temp folder '{0}' created. + {0} = temp folder path + + + Copy '{0}' to '{1}'. + {0} = source, {1} = destination + + + Copy the module '{0}' to '{1}'. + {0} = source, {1} = destination + + + File '{0}' already exists. Use the -Force parameter to overwrite it. + {0} is the path to a file + + + Configuration file '{0}' not found. + 0 = path to the configuration file + + + Path '{0}' not found. + 0 = path to the additional content file/directory + + + Path '{0}' not found. + 0 = path to the additional content file/directory + + + Invalid configuration file: {0}. +The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip). + 0 = path to the configuration file + + + Invalid configuration file: {0}. +The file needs to be a PowerShell script (.ps1 or .psm1). + 0 = path to the configuration file + + + Create Archive + + + Upload '{0}' + {0} is the name of an storage blob + + + Storage Blob '{0}' already exists. Use the -Force parameter to overwrite it. + {0} is the name of an storage blob + + + Configuration published to {0} + {0} is an URI + + + Deleted '{0}' + {0} is the path of a file + + + Cannot delete '{0}': {1} + {0} is the path of a file, {1} is an error message + + + Cannot find the WadCfg end element in the config. + + + WadCfg start element in the config is not matching the end element. + + + Cannot find the WadCfg element in the config. + + + Cannot find configuration data file: {0} + + + The configuration data must be a .psd1 file + + + Cannot change built-in environment {0}. + + + Azure PowerShell collects usage data in order to improve your experience. +The data is anonymous and does not include commandline argument values. +The data is collected by Microsoft. + +Use the Disable-AzDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Az.Accounts module. To disable data collection: PS > Disable-AzDataCollection. +Use the Enable-AzDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Az.Accounts module. To enable data collection: PS > Enable-AzDataCollection. + + + Microsoft Azure PowerShell Data Collection Confirmation + + + You choose not to participate in Microsoft Azure PowerShell data collection. + + + This confirmation message will be dismissed in '{0}' second(s)... + + + You choose to participate in Microsoft Azure PowerShell data collection. + + + The setting profile has been saved to the following path '{0}'. + + + [Common.Authentication]: Authenticating for account {0} with single tenant {1}. + + + Changing public environment is not supported. + + + Environment name needs to be specified. + + + Environment needs to be specified. + + + The environment name '{0}' is not found. + + + File path is not valid. + + + Must specify a non-null subscription name. + + + The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription. + + + Removing public environment is not supported. + + + The subscription id {0} doesn't exist. + + + Subscription name needs to be specified. + + + The subscription name {0} doesn't exist. + + + Subscription needs to be specified. + + + User name is not valid. + + + User name needs to be specified. + + + "There is no current context, please log in using Connect-AzAccount." + + + No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Connect-AzAccount? + + + No certificate was found in the certificate store with thumbprint {0} + + + Illegal characters in path. + + + Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings + + + "{0}" is an invalid DNS name for {1} + + + The provided file in {0} must be have {1} extension + + + {0} is invalid or empty + + + Please connect to internet before executing this cmdlet + + + Path {0} doesn't exist. + + + Path for {0} doesn't exist in {1}. + + + &whr={0} + + + The provided service name {0} already exists, please pick another name + + + Unable to update mismatching Json structured: {0} {1}. + + + (x86) + + + Azure PowerShell collects usage data in order to improve your experience. +The data is anonymous and does not include commandline argument values. +The data is collected by Microsoft. + +Use the Disable-AzureDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Azure module. To disable data collection: PS > Disable-AzureDataCollection. +Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Azure module. To enable data collection: PS > Enable-AzureDataCollection. + + + Execution failed because a background thread could not prompt the user. + + + Azure Long-Running Job + + + The cmdlet failed in background execution. The returned error was '{0}'. Please execute the cmdlet again. You may need to execute this cmdlet synchronously, by omitting the '-AsJob' parameter. + 0(string): exception message in background task + + + Please execute the cmdlet again and include the 'Force' parameter, if available, to avoid unnecessary prompts. + + + Please execute the cmdlet again and omit the 'Confirm' parameter when using the 'AsJob' parameter. + + + Please increase the user $ConfirmPreference setting, or include turn off confirmation using '-Confirm:$false' when using the 'AsJob' parameter and execute the cmdet again. + + + Please execute the cmdlet again and omit the 'WhatIf' parameter when using the 'AsJob' parameter. + + + [AzureLongRunningJob]: Starting cmdlet execution, setting for cmdlet confirmation required: '{0}' + 0(bool): whether cmdlet confirmation is required + + + [AzureLongRunningJob]: Blocking job for ShouldMethod '{0}' + 0(string): method type + + + [AzureLongRunningJob]: Completing cmdlet execution in RunJob + + + [AzureLongRunningJob]: State change from '{0}' to '{1}' because '{2}' + 0(string): last state, 1(string): new state, 2(string): state change reason + + + [AzureLongRunningJob]: Unblocking job due to stoppage or failure + + + [AzureLongRunningJob]: Unblocking job that was previously blocked. + + + [AzureLongRunningJob]: Error in cmdlet execution + + + [AzureLongRunningJob]: Removing state changed event handler, exception '{0}' + 0(string): exception message + + + [AzureLongRunningJob]: ShouldMethod '{0}' unblocked. + 0(string): methodType + + + +- The parameter : '{0}' is changing. + + + +- The parameter : '{0}' is becoming mandatory. + + + +- The parameter : '{0}' is being replaced by parameter : '{1}'. + + + +- The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. + + + +- Change description : {0} + + + The cmdlet is being deprecated. There will be no replacement for it. + + + The cmdlet parameter set is being deprecated. There will be no replacement for it. + + + The cmdlet '{0}' is replacing this cmdlet. + + + +- The output type is changing from the existing type :'{0}' to the new type :'{1}' + + + +- The output type '{0}' is changing + + + +- The following properties are being added to the output type : + + + +- The following properties in the output type are being deprecated : + + + {0} + + + +- Cmdlet : '{0}' + - {1} + + + Upcoming breaking changes in the cmdlet '{0}' : + + + +- This change will take effect on '{0}' + + + +- The change is expected to take effect from version : '{0}' + + + ```powershell +# Old +{0} + +# New +{1} +``` + + + + +Cmdlet invocation changes : + Old Way : {0} + New Way : {1} + + + +The output type '{0}' is being deprecated without a replacement. + + + +The type of the parameter is changing from '{0}' to '{1}'. + + + +Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. + + + This cmdlet is in preview. Its behavior is subject to change based on customer feedback. + + + The estimated generally available date is '{0}'. + + + - The change is expected to take effect from Az version : '{0}' + + \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Response.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Response.cs new file mode 100644 index 000000000000..42d900455d71 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Serialization/JsonSerializer.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Serialization/JsonSerializer.cs new file mode 100644 index 000000000000..00a6dd9483c6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Serialization/PropertyTransformation.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Serialization/PropertyTransformation.cs new file mode 100644 index 000000000000..f6e68422cf97 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Serialization/SerializationOptions.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Serialization/SerializationOptions.cs new file mode 100644 index 000000000000..14c0257cace1 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/SerializationMode.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/SerializationMode.cs new file mode 100644 index 000000000000..5e82a363a8eb --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/TypeConverterExtensions.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/TypeConverterExtensions.cs new file mode 100644 index 000000000000..7ad009da659d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/TypeConverterExtensions.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. + *--------------------------------------------------------------------------------------------*/ +using System.IO; +using System.Linq; +using System.Xml; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Runtime.PowerShell +{ + internal static class TypeConverterExtensions + { + internal static T[] SelectToArray(object source, System.Func converter) + { + // null begets null + if (source == null) + { + return null; + } + + // single values and strings are just encapsulated in the array. + if (source is string || !(source is System.Collections.IEnumerable)) + { + try + { + return new T[] { (T)converter(source) }; + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + return new T[0]; // empty result if couldn't convert. + } + + var result = new System.Collections.Generic.List(); + foreach (var each in (System.Collections.IEnumerable)source) + { + try + { + result.Add((T)converter(each)); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + } + return result.ToArray(); + } + + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) + { + if (null != dictionary) + { + foreach (var each in dictionary.Keys) + { + yield return each; + } + } + } + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.IDictionary dictionary) + { + if (null != dictionary) + { + foreach (var each in dictionary.Keys) + { + yield return each; + } + } + } + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Management.Automation.PSObject instance) + { + if (null != instance) + { + foreach (var each in instance.Properties) + { + yield return each; + } + } + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Collections.Generic.IDictionary instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + return (null == instance || instance.Count == 0) ? + Enumerable.Empty>() : + instance.Keys + .Where(key => + !(true == exclusions?.Contains(key?.ToString())) + && (false != inclusions?.Contains(key?.ToString()))) + .Select(key => new System.Collections.Generic.KeyValuePair(key, instance[key])); + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Collections.IDictionary instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + return (null == instance || instance.Count == 0) ? + Enumerable.Empty>() : + instance.Keys.OfType() + .Where(key => + !(true == exclusions?.Contains(key?.ToString())) + && (false != inclusions?.Contains(key?.ToString()))) + .Select(key => new System.Collections.Generic.KeyValuePair(key, instance[key])); + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Management.Automation.PSObject instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + // new global::System.Collections.Generic.HashSet(System.StringComparer.InvariantCultureIgnoreCase) + return (null == instance || !instance.Properties.Any()) ? + Enumerable.Empty>() : + instance.Properties + .Where(property => + !(true == exclusions?.Contains(property.Name)) + && (false != inclusions?.Contains(property.Name))) + .Select(property => new System.Collections.Generic.KeyValuePair(property.Name, property.Value)); + } + + + internal static T GetValueForProperty(this System.Collections.Generic.IDictionary dictionary, string propertyName, T defaultValue, System.Func converter) + { + try + { + var key = System.Linq.Enumerable.FirstOrDefault(dictionary.Keys, each => System.String.Equals(each.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return key == null ? defaultValue : (T)converter(dictionary[key]); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + internal static T GetValueForProperty(this System.Collections.IDictionary dictionary, string propertyName, T defaultValue, System.Func converter) + { + try + { + var key = System.Linq.Enumerable.FirstOrDefault(dictionary.Keys.OfType(), each => System.String.Equals(each.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return key == null ? defaultValue : (T)converter(dictionary[key]); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + + internal static T GetValueForProperty(this System.Management.Automation.PSObject psObject, string propertyName, T defaultValue, System.Func converter) + { + try + { + var property = System.Linq.Enumerable.FirstOrDefault(psObject.Properties, each => System.String.Equals(each.Name.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return property == null ? defaultValue : (T)converter(property.Value); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + + internal static bool Contains(this System.Management.Automation.PSObject psObject, string propertyName) + { + bool result = false; + try + { + var property = System.Linq.Enumerable.FirstOrDefault(psObject.Properties, each => System.String.Equals(each.Name.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + result = property == null ? false : true; + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return result; + } + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/UndeclaredResponseException.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/UndeclaredResponseException.cs new file mode 100644 index 000000000000..7b6cc3ef1a7c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/Writers/JsonWriter.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/Writers/JsonWriter.cs new file mode 100644 index 000000000000..b5cfba60f69c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/generated/runtime/delegates.cs b/swaggerci/recoveryservicesbackup.DefaultTag/generated/runtime/delegates.cs new file mode 100644 index 000000000000..0b328f813449 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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.DefaultTag/how-to.md b/swaggerci/recoveryservicesbackup.DefaultTag/how-to.md new file mode 100644 index 000000000000..675ed4d546b0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/how-to.md @@ -0,0 +1,58 @@ +# How-To +This document describes how to develop for `Az.RecoveryServicesBackup`. + +## Building `Az.RecoveryServicesBackup` +To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `exports` folder. To read more about the proxy script cmdlets, look at the [README.md](exports/README.md) in the `exports` folder. + +## Creating custom cmdlets +To add cmdlets that were not generated by the REST specification, use the `custom` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [README.md](custom/README.md) in the `custom` folder. + +## Generating documentation +To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [README.md](examples/README.md) in the `examples` folder. To read more about documentation, look at the [README.md](docs/README.md) in the `docs` folder. + +## Testing `Az.RecoveryServicesBackup` +To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [README.md](examples/README.md) in the `examples` folder. + +## Packing `Az.RecoveryServicesBackup` +To pack `Az.RecoveryServicesBackup` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://learn.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. + +## Module Script Details +There are multiple scripts created for performing different actions for developing `Az.RecoveryServicesBackup`. +- `build-module.ps1` + - Builds the module DLL (`./bin/Az.RecoveryServicesBackup.private.dll`), creates the exported cmdlets and documentation, generates custom cmdlet test stubs and exported cmdlet example stubs, and updates `./Az.RecoveryServicesBackup.psd1` with Azure profile information. + - **Parameters**: [`Switch` parameters] + - `-Run`: After building, creates an isolated PowerShell session and loads `Az.RecoveryServicesBackup`. + - `-Test`: After building, runs the `Pester` tests defined in the `test` folder. + - `-Docs`: After building, generates the Markdown documents for the modules into the `docs` folder. + - `-Pack`: After building, packages the module into a `.nupkg`. + - `-Code`: After building, opens a VSCode window with the module's directory and runs (see `-Run`) the module. + - `-Release`: Builds the module in `Release` configuration (as opposed to `Debug` configuration). + - `-NoDocs`: Supresses writing the documentation markdown files as part of the cmdlet exporting process. + - `-Debugger`: Used when attaching the debugger in Visual Studio to the PowerShell session, and running the build process without recompiling the DLL. This suppresses running the script as an isolated process. +- `run-module.ps1` + - Creates an isolated PowerShell session and loads `Az.RecoveryServicesBackup` into the session. + - Same as `-Run` in `build-module.ps1`. + - **Parameters**: [`Switch` parameters] + - `-Code`: Opens a VSCode window with the module's directory. + - Same as `-Code` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. +- `test-module.ps1` + - Runs the `Pester` tests defined in the `test` folder. + - Same as `-Test` in `build-module.ps1`. +- `pack-module.ps1` + - Packages the module into a `.nupkg` for distribution. + - Same as `-Pack` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. + - This process is now integrated into `build-module.ps1` automatically. To disable, use `-NoDocs` when running `build-module.ps1`. +- `export-surface.ps1` + - Generates Markdown documents for both the cmdlet surface and the model (class) surface of the module. + - These files are placed into the `resources` folder. + - Used for investigating the surface of your module. These are *not* documentation for distribution. +- `check-dependencies.ps1` + - Used in `run-module.ps1` and `test-module.ps1` to verify dependent modules are available to run those tasks. + - It will download local (within the module's directory structure) versions of those modules as needed. + - This script *does not* need to be ran by-hand. \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/internal/Az.RecoveryServicesBackup.internal.psm1 b/swaggerci/recoveryservicesbackup.DefaultTag/internal/Az.RecoveryServicesBackup.internal.psm1 new file mode 100644 index 000000000000..9a6ff2681e7f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/internal/Az.RecoveryServicesBackup.internal.psm1 @@ -0,0 +1,38 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.RecoveryServicesBackup.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.RecoveryServicesBackup.Module]::Instance + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export proxy cmdlet scripts + $exportsPath = $PSScriptRoot + $directories = Get-ChildItem -Directory -Path $exportsPath + $profileDirectory = $null + if($instance.ProfileName) { + if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) { + $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName } + } else { + # Don't export anything if the profile doesn't exist for the module + $exportsPath = $null + Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded." + } + } elseif(($directories | Measure-Object).Count -gt 0) { + # Load the last folder if no profile is selected + $profileDirectory = $directories | Select-Object -Last 1 + } + + if($profileDirectory) { + Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" + $exportsPath = $profileDirectory.FullName + } + + if($exportsPath) { + Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath + Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias) + } +# endregion diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/internal/README.md b/swaggerci/recoveryservicesbackup.DefaultTag/internal/README.md new file mode 100644 index 000000000000..9780c40bd818 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/internal/README.md @@ -0,0 +1,14 @@ +# Internal +This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#cmdlet-hiding-exportation-suppression). The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `../custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The `Az.RecoveryServicesBackup.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.RecoveryServicesBackup`. Instead, this sub-module is imported by the `../custom/Az.RecoveryServicesBackup.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.RecoveryServicesBackup.internal\Get-Example` would call an internal cmdlet named `Get-Example`. + +## Purpose +This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.RecoveryServicesBackup`. diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/license.txt b/swaggerci/recoveryservicesbackup.DefaultTag/license.txt new file mode 100644 index 000000000000..b9f3180fb9af --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/license.txt @@ -0,0 +1,227 @@ +MICROSOFT SOFTWARE LICENSE TERMS + +MICROSOFT AZURE POWERSHELL + +These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. + +BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE. + + +-----------------START OF LICENSE-------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +-------------------END OF LICENSE------------------------------------------ + + +----------------START OF THIRD PARTY NOTICE-------------------------------- + + +The software includes the AutoMapper library ("AutoMapper"). The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Provided for Informational Purposes Only + +AutoMapper + +The MIT License (MIT) +Copyright (c) 2010 Jimmy Bogard + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + + + + +*************** + +The software includes Newtonsoft.Json. The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Newtonsoft.Json + +The MIT License (MIT) +Copyright (c) 2007 James Newton-King +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------END OF THIRD PARTY NOTICE---------------------------------------- + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/pack-module.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/pack-module.ps1 new file mode 100644 index 000000000000..8ed48957e579 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/pack-module.ps1 @@ -0,0 +1,9 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +Write-Host -ForegroundColor Green 'Packing module...' +dotnet pack $PSScriptRoot --no-build /nologo +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/readme.md b/swaggerci/recoveryservicesbackup.DefaultTag/readme.md new file mode 100644 index 000000000000..c56fd5372945 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/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 +``` diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/resources/README.md b/swaggerci/recoveryservicesbackup.DefaultTag/resources/README.md new file mode 100644 index 000000000000..736492341e3d --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `../custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/run-module.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/run-module.ps1 new file mode 100644 index 000000000000..8d77f32a737c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/run-module.ps1 @@ -0,0 +1,54 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Code) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$isAzure = $true +if($isAzure) { + . (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts + # Load the latest version of Az.Accounts installed + Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version +} + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) { + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.RecoveryServicesBackup.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +function Prompt { + Write-Host -NoNewline -ForegroundColor Green "PS $(Get-Location)" + Write-Host -NoNewline -ForegroundColor Gray ' [' + Write-Host -NoNewline -ForegroundColor White -BackgroundColor DarkCyan $moduleName + ']> ' +} + +# where we would find the launch.json file +$vscodeDirectory = New-Item -ItemType Directory -Force -Path (Join-Path $PSScriptRoot '.vscode') +$launchJson = Join-Path $vscodeDirectory 'launch.json' + +# if there is a launch.json file, let's just assume -Code, and update the file +if(($Code) -or (test-Path $launchJson) ) { + $launchContent = '{ "version": "0.2.0", "configurations":[{ "name":"Attach to PowerShell", "type":"coreclr", "request":"attach", "processId":"' + ([System.Diagnostics.Process]::GetCurrentProcess().Id) + '", "justMyCode":false }] }' + Set-Content -Path $launchJson -Value $launchContent + if($Code) { + # only launch vscode if they say -code + code $PSScriptRoot + } +} + +Import-Module -Name $modulePath \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test-module.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/test-module.ps1 new file mode 100644 index 000000000000..c8136a34dae6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test-module.ps1 @@ -0,0 +1,90 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) +{ + Write-Host -ForegroundColor Green 'Creating isolated process...' + if ($PSBoundParameters.ContainsKey("TestName")) { + $PSBoundParameters["TestName"] = $PSBoundParameters["TestName"] -join "," + } + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +# This is a workaround, since for string array parameter, pwsh -File will only take the first element +if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and ($TestName[0].Contains(','))) { + $TestName = $TestName[0].Split(",") +} + +$ProgressPreference = 'SilentlyContinue' +$baseName = $PSScriptRoot.BaseName +$requireResourceModule = (($baseName -ne "Resources") -and ($Record.IsPresent -or $Live.IsPresent)) +. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule +. ("$PSScriptRoot\test\utils.ps1") + +if ($requireResourceModule) +{ + # Load the latest Az.Accounts installed + Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version + $resourceModulePSD = Get-Item -Path (Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psd1') + Import-Module -Name $resourceModulePSD.FullName +} + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) +{ + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.RecoveryServicesBackup.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +Import-Module -Name Pester +Import-Module -Name $modulePath + +$TestMode = 'playback' +$ExcludeTag = @("LiveOnly") +if($Live) +{ + $TestMode = 'live' + $ExcludeTag = @() +} +if($Record) +{ + $TestMode = 'record' +} +try +{ + if ($TestMode -ne 'playback') + { + setupEnv + } else { + $env:AzPSAutorestTestPlaybackMode = $true + } + $testFolder = Join-Path $PSScriptRoot 'test' + if ($null -ne $TestName) + { + Invoke-Pester -Script @{ Path = $testFolder } -TestName $TestName -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") + } else { + Invoke-Pester -Script @{ Path = $testFolder } -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") + } +} Finally +{ + if ($TestMode -ne 'playback') + { + cleanupEnv + } + else { + $env:AzPSAutorestTestPlaybackMode = '' + } +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupAadProperty.Tests.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupAadProperty.Tests.ps1 new file mode 100644 index 000000000000..3c4d4e588ea6 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupAadProperty.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzRecoveryServicesBackupAadProperty')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzRecoveryServicesBackupAadProperty.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzRecoveryServicesBackupAadProperty' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupCrrJob.Tests.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupCrrJob.Tests.ps1 new file mode 100644 index 000000000000..960a44160121 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupCrrJob.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzRecoveryServicesBackupCrrJob')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzRecoveryServicesBackupCrrJob.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzRecoveryServicesBackupCrrJob' { + It 'ListExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupCrrJobDetail.Tests.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupCrrJobDetail.Tests.ps1 new file mode 100644 index 000000000000..04a4f90e82c4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupCrrJobDetail.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzRecoveryServicesBackupCrrJobDetail')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzRecoveryServicesBackupCrrJobDetail.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzRecoveryServicesBackupCrrJobDetail' { + It 'GetExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupCrrOperationResult.Tests.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupCrrOperationResult.Tests.ps1 new file mode 100644 index 000000000000..c35eb4290985 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupCrrOperationResult.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzRecoveryServicesBackupCrrOperationResult')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzRecoveryServicesBackupCrrOperationResult.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzRecoveryServicesBackupCrrOperationResult' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupCrrOperationStatus.Tests.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupCrrOperationStatus.Tests.ps1 new file mode 100644 index 000000000000..f231a413818f --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupCrrOperationStatus.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzRecoveryServicesBackupCrrOperationStatus')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzRecoveryServicesBackupCrrOperationStatus.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzRecoveryServicesBackupCrrOperationStatus' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupProtectedItemsCrr.Tests.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupProtectedItemsCrr.Tests.ps1 new file mode 100644 index 000000000000..1230c6d6d8cc --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupProtectedItemsCrr.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzRecoveryServicesBackupProtectedItemsCrr')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzRecoveryServicesBackupProtectedItemsCrr.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzRecoveryServicesBackupProtectedItemsCrr' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupRecoveryPointAccessToken.Tests.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupRecoveryPointAccessToken.Tests.ps1 new file mode 100644 index 000000000000..7fb5c3a654d0 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupRecoveryPointAccessToken.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzRecoveryServicesBackupRecoveryPointAccessToken')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzRecoveryServicesBackupRecoveryPointAccessToken.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzRecoveryServicesBackupRecoveryPointAccessToken' { + It 'GetExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupRecoveryPointsCrr.Tests.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupRecoveryPointsCrr.Tests.ps1 new file mode 100644 index 000000000000..990cf924b451 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupRecoveryPointsCrr.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzRecoveryServicesBackupRecoveryPointsCrr')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzRecoveryServicesBackupRecoveryPointsCrr.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzRecoveryServicesBackupRecoveryPointsCrr' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupResourceStorageConfig.Tests.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupResourceStorageConfig.Tests.ps1 new file mode 100644 index 000000000000..4f708518db96 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupResourceStorageConfig.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzRecoveryServicesBackupResourceStorageConfig')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzRecoveryServicesBackupResourceStorageConfig.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzRecoveryServicesBackupResourceStorageConfig' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupUsageSummariesCrr.Tests.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupUsageSummariesCrr.Tests.ps1 new file mode 100644 index 000000000000..176540676108 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test/Get-AzRecoveryServicesBackupUsageSummariesCrr.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzRecoveryServicesBackupUsageSummariesCrr')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzRecoveryServicesBackupUsageSummariesCrr.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzRecoveryServicesBackupUsageSummariesCrr' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test/README.md b/swaggerci/recoveryservicesbackup.DefaultTag/test/README.md new file mode 100644 index 000000000000..1969200c6a09 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test/README.md @@ -0,0 +1,17 @@ +# Test +This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `../custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Details +We allow three testing modes: *live*, *record*, and *playback*. These can be selected using the `-Live`, `-Record`, and `-Playback` switches respectively on the `test-module.ps1` script. This script will run through any `.Tests.ps1` scripts in the `test` folder. If you choose the *record* mode, it will create a `.Recording.json` file of the REST calls between the client and server. Then, when you choose *playback* mode, it will use the `.Recording.json` file to mock the communication between server and client. The *live* mode runs the same as the *record* mode; however, it doesn't create the `.Recording.json` file. + +## Purpose +Custom cmdlets generally encompass additional functionality not described in the REST specification, or combines functionality generated from the REST spec. To validate this functionality continues to operate as intended, creating tests that can be ran and re-ran against custom cmdlets is part of the framework. + +## Usage +To execute tests, run the `test-module.ps1`. To write tests, [this example](https://github.com/pester/Pester/blob/8b9cf4248315e44f1ac6673be149f7e0d7f10466/Examples/Planets/Get-Planet.Tests.ps1#L1) from the Pester repository is very useful for getting started. \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test/Start-AzRecoveryServicesBackupCrossRegionRestore.Tests.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/test/Start-AzRecoveryServicesBackupCrossRegionRestore.Tests.ps1 new file mode 100644 index 000000000000..a143664c467c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test/Start-AzRecoveryServicesBackupCrossRegionRestore.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Start-AzRecoveryServicesBackupCrossRegionRestore')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Start-AzRecoveryServicesBackupCrossRegionRestore.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Start-AzRecoveryServicesBackupCrossRegionRestore' { + It 'TriggerExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Trigger' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'TriggerViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'TriggerViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test/Update-AzRecoveryServicesBackupResourceStorageConfig.Tests.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/test/Update-AzRecoveryServicesBackupResourceStorageConfig.Tests.ps1 new file mode 100644 index 000000000000..0be8a20f923c --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test/Update-AzRecoveryServicesBackupResourceStorageConfig.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzRecoveryServicesBackupResourceStorageConfig')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzRecoveryServicesBackupResourceStorageConfig.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzRecoveryServicesBackupResourceStorageConfig' { + It 'PatchExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Patch' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'PatchViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'PatchViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test/loadEnv.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/test/loadEnv.ps1 new file mode 100644 index 000000000000..d2166fb535d4 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test/loadEnv.ps1 @@ -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. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json + $PSDefaultParameterValues=@{"*:Tenant"=$env.Tenant} +} \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/test/utils.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/test/utils.ps1 new file mode 100644 index 000000000000..1990edd45299 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/test/utils.ps1 @@ -0,0 +1,31 @@ +function RandomString([bool]$allChars, [int32]$len) { + if ($allChars) { + return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) + } else { + return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) + } +} +$env = @{} +if ($UsePreviousConfigForRecord) { + $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +function cleanupEnv() { + # Clean resources you create for testing +} + diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/utils/Get-SubscriptionIdTestSafe.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/utils/Get-SubscriptionIdTestSafe.ps1 new file mode 100644 index 000000000000..5319862d3372 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/utils/Get-SubscriptionIdTestSafe.ps1 @@ -0,0 +1,7 @@ +param() +if ($env:AzPSAutorestTestPlaybackMode) { + $loadEnvPath = Join-Path $PSScriptRoot '..' 'test' 'loadEnv.ps1' + . ($loadEnvPath) + return $env.SubscriptionId +} +return (Get-AzContext).Subscription.Id \ No newline at end of file diff --git a/swaggerci/recoveryservicesbackup.DefaultTag/utils/Unprotect-SecureString.ps1 b/swaggerci/recoveryservicesbackup.DefaultTag/utils/Unprotect-SecureString.ps1 new file mode 100644 index 000000000000..cb05b51a6220 --- /dev/null +++ b/swaggerci/recoveryservicesbackup.DefaultTag/utils/Unprotect-SecureString.ps1 @@ -0,0 +1,16 @@ +#This script converts securestring to plaintext + +param( + [Parameter(Mandatory, ValueFromPipeline)] + [System.Security.SecureString] + ${SecureString} +) + +$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString) +try { + $plaintext = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr) +} finally { + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr) +} + +return $plaintext \ No newline at end of file