|
| 1 | +// Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | +// Licensed under the MIT License. |
| 3 | + |
| 4 | +#nullable disable |
| 5 | + |
| 6 | +using System; |
| 7 | +using System.Collections.Generic; |
| 8 | +using System.ComponentModel; |
| 9 | +using System.Linq; |
| 10 | +using System.Net; |
| 11 | +using Azure.Core; |
| 12 | +using Azure.ResourceManager.Models; |
| 13 | + |
| 14 | +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models |
| 15 | +{ |
| 16 | + /// <summary> Model factory for models. </summary> |
| 17 | + public static partial class ArmRecoveryServicesSiteRecoveryModelFactory |
| 18 | + { |
| 19 | + /// <summary> Initializes a new instance of <see cref="Models.SiteRecoveryInnerHealthError"/>. </summary> |
| 20 | + /// <param name="errorSource"> Source of error. </param> |
| 21 | + /// <param name="errorType"> Type of error. </param> |
| 22 | + /// <param name="errorLevel"> Level of error. </param> |
| 23 | + /// <param name="errorCategory"> Category of error. </param> |
| 24 | + /// <param name="errorCode"> Error code. </param> |
| 25 | + /// <param name="summaryMessage"> Summary message of the entity. </param> |
| 26 | + /// <param name="errorMessage"> Error message. </param> |
| 27 | + /// <param name="possibleCauses"> Possible causes of error. </param> |
| 28 | + /// <param name="recommendedAction"> Recommended action to resolve error. </param> |
| 29 | + /// <param name="createdOn"> Error creation time (UTC). </param> |
| 30 | + /// <param name="recoveryProviderErrorMessage"> DRA error message. </param> |
| 31 | + /// <param name="entityId"> ID of the entity. </param> |
| 32 | + /// <param name="errorId"> The health error unique id. </param> |
| 33 | + /// <param name="customerResolvability"> Value indicating whether the health error is customer resolvable. </param> |
| 34 | + /// <returns> A new <see cref="Models.SiteRecoveryInnerHealthError"/> instance for mocking. </returns> |
| 35 | + [EditorBrowsable(EditorBrowsableState.Never)] |
| 36 | + public static SiteRecoveryInnerHealthError SiteRecoveryInnerHealthError(string errorSource, string errorType, string errorLevel, string errorCategory, string errorCode, string summaryMessage, string errorMessage, string possibleCauses, string recommendedAction, DateTimeOffset? createdOn, string recoveryProviderErrorMessage, string entityId, string errorId, HealthErrorCustomerResolvability? customerResolvability) |
| 37 | + { |
| 38 | + return new SiteRecoveryInnerHealthError( |
| 39 | + errorSource, |
| 40 | + errorType, |
| 41 | + errorLevel, |
| 42 | + errorCategory, |
| 43 | + errorCode, |
| 44 | + summaryMessage, |
| 45 | + errorMessage, |
| 46 | + possibleCauses, |
| 47 | + recommendedAction, |
| 48 | + createdOn, |
| 49 | + recoveryProviderErrorMessage, |
| 50 | + entityId, |
| 51 | + errorId, |
| 52 | + customerResolvability, |
| 53 | + null); |
| 54 | + } |
| 55 | + |
| 56 | + /// <summary> Initializes a new instance of <see cref="Models.A2AProtectedManagedDiskDetails"/>. </summary> |
| 57 | + /// <param name="diskId"> The managed disk Arm id. </param> |
| 58 | + /// <param name="recoveryResourceGroupId"> The recovery disk resource group Arm Id. </param> |
| 59 | + /// <param name="recoveryTargetDiskId"> Recovery target disk Arm Id. </param> |
| 60 | + /// <param name="recoveryReplicaDiskId"> Recovery replica disk Arm Id. </param> |
| 61 | + /// <param name="recoveryOrignalTargetDiskId"> Recovery original target disk Arm Id. </param> |
| 62 | + /// <param name="recoveryReplicaDiskAccountType"> The replica disk type. Its an optional value and will be same as source disk type if not user provided. </param> |
| 63 | + /// <param name="recoveryTargetDiskAccountType"> The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. </param> |
| 64 | + /// <param name="recoveryDiskEncryptionSetId"> The recovery disk encryption set Id. </param> |
| 65 | + /// <param name="primaryDiskEncryptionSetId"> The primary disk encryption set Id. </param> |
| 66 | + /// <param name="diskName"> The disk name. </param> |
| 67 | + /// <param name="diskCapacityInBytes"> The disk capacity in bytes. </param> |
| 68 | + /// <param name="primaryStagingAzureStorageAccountId"> The primary staging storage account. </param> |
| 69 | + /// <param name="diskType"> The type of disk. </param> |
| 70 | + /// <param name="isResyncRequired"> A value indicating whether resync is required for this disk. </param> |
| 71 | + /// <param name="monitoringPercentageCompletion"> The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. </param> |
| 72 | + /// <param name="monitoringJobType"> The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. </param> |
| 73 | + /// <param name="dataPendingInStagingStorageAccountInMB"> The data pending for replication in MB at staging account. </param> |
| 74 | + /// <param name="dataPendingAtSourceAgentInMB"> The data pending at source virtual machine in MB. </param> |
| 75 | + /// <param name="diskState"> The disk state. </param> |
| 76 | + /// <param name="allowedDiskLevelOperation"> The disk level operations list. </param> |
| 77 | + /// <param name="isDiskEncrypted"> A value indicating whether vm has encrypted os disk or not. </param> |
| 78 | + /// <param name="secretIdentifier"> The secret URL / identifier (BEK). </param> |
| 79 | + /// <param name="dekKeyVaultArmId"> The KeyVault resource id for secret (BEK). </param> |
| 80 | + /// <param name="isDiskKeyEncrypted"> A value indicating whether disk key got encrypted or not. </param> |
| 81 | + /// <param name="keyIdentifier"> The key URL / identifier (KEK). </param> |
| 82 | + /// <param name="kekKeyVaultArmId"> The KeyVault resource id for key (KEK). </param> |
| 83 | + /// <param name="failoverDiskName"> The failover name for the managed disk. </param> |
| 84 | + /// <param name="tfoDiskName"> The test failover name for the managed disk. </param> |
| 85 | + /// <returns> A new <see cref="Models.A2AProtectedManagedDiskDetails"/> instance for mocking. </returns> |
| 86 | + [EditorBrowsable(EditorBrowsableState.Never)] |
| 87 | + public static A2AProtectedManagedDiskDetails A2AProtectedManagedDiskDetails(String diskId, ResourceIdentifier recoveryResourceGroupId, ResourceIdentifier recoveryTargetDiskId, ResourceIdentifier recoveryReplicaDiskId, ResourceIdentifier recoveryOrignalTargetDiskId, string recoveryReplicaDiskAccountType, string recoveryTargetDiskAccountType, ResourceIdentifier recoveryDiskEncryptionSetId, ResourceIdentifier primaryDiskEncryptionSetId, string diskName, long? diskCapacityInBytes, ResourceIdentifier primaryStagingAzureStorageAccountId, string diskType, bool? isResyncRequired, int? monitoringPercentageCompletion, string monitoringJobType, double? dataPendingInStagingStorageAccountInMB, double? dataPendingAtSourceAgentInMB, string diskState, IEnumerable<string> allowedDiskLevelOperation, bool? isDiskEncrypted, string secretIdentifier, ResourceIdentifier dekKeyVaultArmId, bool? isDiskKeyEncrypted, string keyIdentifier, ResourceIdentifier kekKeyVaultArmId, string failoverDiskName, string tfoDiskName) |
| 88 | + { |
| 89 | + allowedDiskLevelOperation ??= new List<string>(); |
| 90 | + |
| 91 | + return new A2AProtectedManagedDiskDetails( |
| 92 | + diskId, |
| 93 | + recoveryResourceGroupId, |
| 94 | + recoveryTargetDiskId, |
| 95 | + recoveryReplicaDiskId, |
| 96 | + recoveryOrignalTargetDiskId, |
| 97 | + recoveryReplicaDiskAccountType, |
| 98 | + recoveryTargetDiskAccountType, |
| 99 | + recoveryDiskEncryptionSetId, |
| 100 | + primaryDiskEncryptionSetId, |
| 101 | + diskName, |
| 102 | + diskCapacityInBytes, |
| 103 | + primaryStagingAzureStorageAccountId, |
| 104 | + diskType, |
| 105 | + isResyncRequired, |
| 106 | + monitoringPercentageCompletion, |
| 107 | + monitoringJobType, |
| 108 | + dataPendingInStagingStorageAccountInMB, |
| 109 | + dataPendingAtSourceAgentInMB, |
| 110 | + diskState, |
| 111 | + allowedDiskLevelOperation?.ToList(), |
| 112 | + isDiskEncrypted, |
| 113 | + secretIdentifier, |
| 114 | + dekKeyVaultArmId, |
| 115 | + isDiskKeyEncrypted, |
| 116 | + keyIdentifier, |
| 117 | + kekKeyVaultArmId, |
| 118 | + failoverDiskName, |
| 119 | + tfoDiskName, |
| 120 | + null); |
| 121 | + } |
| 122 | + |
| 123 | + /// <summary> Initializes a new instance of <see cref="Models.A2AUnprotectedDiskDetails"/>. </summary> |
| 124 | + /// <param name="diskLunId"> The source lun Id for the data disk. </param> |
| 125 | + /// <param name="diskAutoProtectionStatus"> A value indicating whether the disk auto protection is enabled. </param> |
| 126 | + /// <returns> A new <see cref="Models.A2AUnprotectedDiskDetails"/> instance for mocking. </returns> |
| 127 | + [EditorBrowsable(EditorBrowsableState.Never)] |
| 128 | + public static A2AUnprotectedDiskDetails A2AUnprotectedDiskDetails(int? diskLunId, AutoProtectionOfDataDisk? diskAutoProtectionStatus) |
| 129 | + { |
| 130 | + return new A2AUnprotectedDiskDetails(diskLunId, diskAutoProtectionStatus, null); |
| 131 | + } |
| 132 | + |
| 133 | + /// <summary> Initializes a new instance of <see cref="Models.CurrentScenarioDetails"/>. </summary> |
| 134 | + /// <param name="scenarioName"> Scenario name. </param> |
| 135 | + /// <param name="jobId"> ARM Id of the job being executed. </param> |
| 136 | + /// <param name="startOn"> Start time of the workflow. </param> |
| 137 | + /// <returns> A new <see cref="Models.CurrentScenarioDetails"/> instance for mocking. </returns> |
| 138 | + [EditorBrowsable(EditorBrowsableState.Never)] |
| 139 | + public static CurrentScenarioDetails CurrentScenarioDetails(string scenarioName, ResourceIdentifier jobId, DateTimeOffset? startOn) |
| 140 | + { |
| 141 | + return new CurrentScenarioDetails(scenarioName, jobId, startOn, null); |
| 142 | + } |
| 143 | + |
| 144 | + /// <summary> Initializes a new instance of <see cref="Models.SiteRecoveryHealthError"/>. </summary> |
| 145 | + /// <param name="innerHealthErrors"> The inner health errors. HealthError having a list of HealthError as child errors is problematic. InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. </param> |
| 146 | + /// <param name="errorSource"> Source of error. </param> |
| 147 | + /// <param name="errorType"> Type of error. </param> |
| 148 | + /// <param name="errorLevel"> Level of error. </param> |
| 149 | + /// <param name="errorCategory"> Category of error. </param> |
| 150 | + /// <param name="errorCode"> Error code. </param> |
| 151 | + /// <param name="summaryMessage"> Summary message of the entity. </param> |
| 152 | + /// <param name="errorMessage"> Error message. </param> |
| 153 | + /// <param name="possibleCauses"> Possible causes of error. </param> |
| 154 | + /// <param name="recommendedAction"> Recommended action to resolve error. </param> |
| 155 | + /// <param name="creationTimeUtc"> Error creation time (UTC). </param> |
| 156 | + /// <param name="recoveryProviderErrorMessage"> DRA error message. </param> |
| 157 | + /// <param name="entityId"> ID of the entity. </param> |
| 158 | + /// <param name="errorId"> The health error unique id. </param> |
| 159 | + /// <param name="customerResolvability"> Value indicating whether the health error is customer resolvable. </param> |
| 160 | + /// <returns> A new <see cref="Models.SiteRecoveryHealthError"/> instance for mocking. </returns> |
| 161 | + [EditorBrowsable(EditorBrowsableState.Never)] |
| 162 | + public static SiteRecoveryHealthError SiteRecoveryHealthError(IEnumerable<SiteRecoveryInnerHealthError> innerHealthErrors, string errorSource, string errorType, string errorLevel, string errorCategory, string errorCode, string summaryMessage, string errorMessage, string possibleCauses, string recommendedAction, DateTimeOffset? creationTimeUtc, string recoveryProviderErrorMessage, string entityId, string errorId, HealthErrorCustomerResolvability? customerResolvability) |
| 163 | + { |
| 164 | + innerHealthErrors ??= new List<SiteRecoveryInnerHealthError>(); |
| 165 | + |
| 166 | + return new SiteRecoveryHealthError( |
| 167 | + innerHealthErrors?.ToList(), |
| 168 | + errorSource, |
| 169 | + errorType, |
| 170 | + errorLevel, |
| 171 | + errorCategory, |
| 172 | + errorCode, |
| 173 | + summaryMessage, |
| 174 | + errorMessage, |
| 175 | + possibleCauses, |
| 176 | + recommendedAction, |
| 177 | + creationTimeUtc, |
| 178 | + recoveryProviderErrorMessage, |
| 179 | + entityId, |
| 180 | + errorId, |
| 181 | + customerResolvability, |
| 182 | + null); |
| 183 | + } |
| 184 | + } |
| 185 | +} |
0 commit comments