Beispiel #1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (DataSourceInfo == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "DataSourceInfo");
     }
     if (PolicyInfo == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "PolicyInfo");
     }
     if (ObjectType == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ObjectType");
     }
     if (DataSourceInfo != null)
     {
         DataSourceInfo.Validate();
     }
     if (DataSourceSetInfo != null)
     {
         DataSourceSetInfo.Validate();
     }
     if (PolicyInfo != null)
     {
         PolicyInfo.Validate();
     }
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the BackupInstance class.
 /// </summary>
 /// <param name="dataSourceInfo">Gets or sets the data source
 /// information.</param>
 /// <param name="policyInfo">Gets or sets the policy
 /// information.</param>
 /// <param name="friendlyName">Gets or sets the Backup Instance
 /// friendly name.</param>
 /// <param name="dataSourceSetInfo">Gets or sets the data source set
 /// information.</param>
 /// <param name="protectionStatus">Specifies the protection status of
 /// the resource</param>
 /// <param name="currentProtectionState">Specifies the current
 /// protection state of the resource. Possible values include:
 /// 'Invalid', 'NotProtected', 'ConfiguringProtection',
 /// 'ProtectionConfigured', 'BackupSchedulesSuspended',
 /// 'RetentionSchedulesSuspended', 'ProtectionStopped',
 /// 'ProtectionError', 'ConfiguringProtectionFailed', 'SoftDeleting',
 /// 'SoftDeleted', 'UpdatingProtection'</param>
 /// <param name="protectionErrorDetails">Specifies the protection error
 /// of the resource</param>
 /// <param name="provisioningState">Specifies the provisioning state of
 /// the resource i.e. provisioning/updating/Succeeded/Failed</param>
 public BackupInstance(Datasource dataSourceInfo, PolicyInfo policyInfo, string objectType, string friendlyName = default(string), DatasourceSet dataSourceSetInfo = default(DatasourceSet), ProtectionStatusDetails protectionStatus = default(ProtectionStatusDetails), string currentProtectionState = default(string), UserFacingError protectionErrorDetails = default(UserFacingError), string provisioningState = default(string))
 {
     FriendlyName           = friendlyName;
     DataSourceInfo         = dataSourceInfo;
     DataSourceSetInfo      = dataSourceSetInfo;
     PolicyInfo             = policyInfo;
     ProtectionStatus       = protectionStatus;
     CurrentProtectionState = currentProtectionState;
     ProtectionErrorDetails = protectionErrorDetails;
     ProvisioningState      = provisioningState;
     ObjectType             = objectType;
     CustomInit();
 }