示例#1
0
文件: VmDisk.cs 项目: gmlp/PowerShell
        /// <summary>Validates that this object meets the validation criteria.</summary>
        /// <param name="eventListener">an <see cref="Microsoft.Rest.ClientRuntime.IEventListener" /> instance that will receive validation
        /// events.</param>
        /// <returns>
        /// A <see cref="System.Threading.Tasks.Task" /> that will be complete when validation is completed.
        /// </returns>
        public async System.Threading.Tasks.Task Validate(Microsoft.Rest.ClientRuntime.IEventListener eventListener)
        {
            await eventListener.AssertObjectIsValid(nameof(DataSourceReference), DataSourceReference);

            await eventListener.AssertObjectIsValid(nameof(DeviceProperties), DeviceProperties);

            await eventListener.AssertIsGreaterThanOrEqual(nameof(DiskSizeBytes), DiskSizeBytes, 1);

            await eventListener.AssertIsGreaterThanOrEqual(nameof(DiskSizeMib), DiskSizeMib, 1);

            await eventListener.AssertRegEx(nameof(Uuid), Uuid, @"^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$");

            await eventListener.AssertObjectIsValid(nameof(VolumeGroupReference), VolumeGroupReference);
        }
示例#2
0
        /// <summary>Validates that this object meets the validation criteria.</summary>
        /// <param name="eventListener">an <see cref="Microsoft.Rest.ClientRuntime.IEventListener" /> instance that will receive validation
        /// events.</param>
        /// <returns>
        /// A <see cref="System.Threading.Tasks.Task" /> that will be complete when validation is completed.
        /// </returns>
        public async System.Threading.Tasks.Task Validate(Microsoft.Rest.ClientRuntime.IEventListener eventListener)
        {
            await eventListener.AssertObjectIsValid(nameof(BootConfig), BootConfig);

            if (DiskList != null)
            {
                for (int __i = 0; __i < DiskList.Length; __i++)
                {
                    await eventListener.AssertObjectIsValid($"DiskList[{__i}]", DiskList[__i]);
                }
            }
            if (GpuList != null)
            {
                for (int __i = 0; __i < GpuList.Length; __i++)
                {
                    await eventListener.AssertObjectIsValid($"GpuList[{__i}]", GpuList[__i]);
                }
            }
            await eventListener.AssertObjectIsValid(nameof(GuestCustomization), GuestCustomization);

            await eventListener.AssertMaximumLength(nameof(GuestOsId), GuestOsId, 64);

            await eventListener.AssertObjectIsValid(nameof(GuestTools), GuestTools);

            await eventListener.AssertMaximumLength(nameof(HardwareClockTimezone), HardwareClockTimezone, 64);

            await eventListener.AssertIsGreaterThanOrEqual(nameof(MemorySizeMib), MemorySizeMib, 1);

            if (NicList != null)
            {
                for (int __i = 0; __i < NicList.Length; __i++)
                {
                    await eventListener.AssertObjectIsValid($"NicList[{__i}]", NicList[__i]);
                }
            }
            await eventListener.AssertIsGreaterThanOrEqual(nameof(NumSockets), NumSockets, 1);

            await eventListener.AssertIsGreaterThanOrEqual(nameof(NumVcpusPerSocket), NumVcpusPerSocket, 1);

            await eventListener.AssertObjectIsValid(nameof(ParentReference), ParentReference);

            await eventListener.AssertObjectIsValid(nameof(PowerStateMechanism), PowerStateMechanism);

            await eventListener.AssertObjectIsValid(nameof(VnumaConfig), VnumaConfig);
        }
示例#3
0
 /// <summary>Validates that this object meets the validation criteria.</summary>
 /// <param name="eventListener">an <see cref="Microsoft.Rest.ClientRuntime.IEventListener" /> instance that will receive validation
 /// events.</param>
 /// <returns>
 /// A <see cref="System.Threading.Tasks.Task" /> that will be complete when validation is completed.
 /// </returns>
 public async System.Threading.Tasks.Task Validate(Microsoft.Rest.ClientRuntime.IEventListener eventListener)
 {
     await eventListener.AssertIsGreaterThanOrEqual(nameof(Length), Length, 1);
 }