/// <summary> /// Initializes a new instance of the Snapshot 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="managedBy">Unused. Always Null.</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="provisioningState">The disk provisioning /// state.</param> public Snapshot(string location, CreationData creationData, string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), string managedBy = default(string), SnapshotSku sku = default(SnapshotSku), System.DateTime?timeCreated = default(System.DateTime?), OperatingSystemTypes?osType = default(OperatingSystemTypes?), int?diskSizeGB = default(int?), EncryptionSettings encryptionSettings = default(EncryptionSettings), string provisioningState = default(string)) : base(location, id, name, type, tags) { ManagedBy = managedBy; Sku = sku; TimeCreated = timeCreated; OsType = osType; CreationData = creationData; DiskSizeGB = diskSizeGB; EncryptionSettings = encryptionSettings; ProvisioningState = provisioningState; CustomInit(); }
/// <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(); } }