/// <summary>
 /// Initializes a new instance of the SnapshotUpdate class.
 /// </summary>
 /// <param name="tags">Resource tags</param>
 /// <param name="accountType">the storage account type of the disk.
 /// Possible values include: 'Standard_LRS', 'Premium_LRS'</param>
 /// <param name="osType">the Operating System type. Possible values
 /// include: 'Windows', 'Linux'</param>
 /// <param name="creationData">disk source information. CreationData
 /// information cannot be changed after the disk has been
 /// created.</param>
 /// <param name="diskSizeGB">If creationData.createOption is Empty,
 /// this field is mandatory and it indicates the size of the VHD to
 /// create. If this field is present for updates or creation with other
 /// options, it indicates a resize. Resizes are only allowed if the
 /// disk is not attached to a running VM, and can only increase the
 /// disk's size.</param>
 /// <param name="encryptionSettings">Encryption settings for disk or
 /// snapshot</param>
 public SnapshotUpdate(IDictionary <string, string> tags = default(IDictionary <string, string>), StorageAccountTypes?accountType = default(StorageAccountTypes?), OperatingSystemTypes?osType = default(OperatingSystemTypes?), CreationData creationData = default(CreationData), int?diskSizeGB = default(int?), EncryptionSettings encryptionSettings = default(EncryptionSettings))
     : base(tags)
 {
     AccountType        = accountType;
     OsType             = osType;
     CreationData       = creationData;
     DiskSizeGB         = diskSizeGB;
     EncryptionSettings = encryptionSettings;
     CustomInit();
 }
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (CreationData != null)
     {
         CreationData.Validate();
     }
     if (EncryptionSettings != null)
     {
         EncryptionSettings.Validate();
     }
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the Disk class.
 /// </summary>
 /// <param name="location">Resource location</param>
 /// <param name="creationData">Disk source information. CreationData
 /// information cannot be changed after the disk has been
 /// created.</param>
 /// <param name="id">Resource Id</param>
 /// <param name="name">Resource name</param>
 /// <param name="type">Resource type</param>
 /// <param name="tags">Resource tags</param>
 /// <param name="accountType">the storage account type of the disk.
 /// Possible values include: 'Standard_LRS', 'Premium_LRS'</param>
 /// <param name="timeCreated">The time when the disk was
 /// created.</param>
 /// <param name="osType">The Operating System type. Possible values
 /// include: 'Windows', 'Linux'</param>
 /// <param name="diskSizeGB">If creationData.createOption is Empty,
 /// this field is mandatory and it indicates the size of the VHD to
 /// create. If this field is present for updates or creation with other
 /// options, it indicates a resize. Resizes are only allowed if the
 /// disk is not attached to a running VM, and can only increase the
 /// disk's size.</param>
 /// <param name="encryptionSettings">Encryption settings for disk or
 /// snapshot</param>
 /// <param name="ownerId">A relative URI containing the VM id that has
 /// the disk attached.</param>
 /// <param name="provisioningState">The disk provisioning
 /// state.</param>
 public Disk(string location, CreationData creationData, string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), StorageAccountTypes?accountType = default(StorageAccountTypes?), System.DateTime?timeCreated = default(System.DateTime?), OperatingSystemTypes?osType = default(OperatingSystemTypes?), int?diskSizeGB = default(int?), EncryptionSettings encryptionSettings = default(EncryptionSettings), string ownerId = default(string), string provisioningState = default(string))
     : base(location, id, name, type, tags)
 {
     AccountType        = accountType;
     TimeCreated        = timeCreated;
     OsType             = osType;
     CreationData       = creationData;
     DiskSizeGB         = diskSizeGB;
     EncryptionSettings = encryptionSettings;
     OwnerId            = ownerId;
     ProvisioningState  = provisioningState;
     CustomInit();
 }
示例#4
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public override void Validate()
 {
     base.Validate();
     if (CreationData == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "CreationData");
     }
     if (CreationData != null)
     {
         CreationData.Validate();
     }
     if (EncryptionSettings != null)
     {
         EncryptionSettings.Validate();
     }
 }