generated/api/Models/HypervisorSettings.PowerShell.cs
// Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.4, generator: @autorest/powershell@3.0.415) // Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Commvault.Powershell.Models { using Commvault.Powershell.Runtime.PowerShell; /// <summary>hypervisorSettings</summary> [System.ComponentModel.TypeConverter(typeof(HypervisorSettingsTypeConverter))] public partial class HypervisorSettings { /// <summary> /// <c>AfterDeserializeDictionary</c> will be called after the deserialization has finished, allowing customization of the /// object before it is returned. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); /// <summary> /// <c>AfterDeserializePSObject</c> will be called after the deserialization has finished, allowing customization of the object /// before it is returned. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); /// <summary> /// <c>BeforeDeserializeDictionary</c> will be called before the deserialization has commenced, allowing complete customization /// of the object before it is deserialized. /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter. /// Implement this method in a partial class to enable this behavior. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return /// instantly.</param> partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); /// <summary> /// <c>BeforeDeserializePSObject</c> will be called before the deserialization has commenced, allowing complete customization /// of the object before it is deserialized. /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter. /// Implement this method in a partial class to enable this behavior. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return /// instantly.</param> partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// <summary> /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into an instance of <see cref="Commvault.Powershell.Models.HypervisorSettings" /// />. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> /// <returns>an instance of <see cref="Commvault.Powershell.Models.IHypervisorSettings" />.</returns> public static Commvault.Powershell.Models.IHypervisorSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new HypervisorSettings(content); } /// <summary> /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into an instance of <see cref="Commvault.Powershell.Models.HypervisorSettings" /// />. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> /// <returns>an instance of <see cref="Commvault.Powershell.Models.IHypervisorSettings" />.</returns> public static Commvault.Powershell.Models.IHypervisorSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new HypervisorSettings(content); } /// <summary> /// Creates a new instance of <see cref="HypervisorSettings" />, deserializing the content from a json string. /// </summary> /// <param name="jsonText">a string containing a JSON serialized instance of this model.</param> /// <returns>an instance of the <see cref="className" /> model class.</returns> public static Commvault.Powershell.Models.IHypervisorSettings FromJsonString(string jsonText) => FromJson(Commvault.Powershell.Runtime.Json.JsonNode.Parse(jsonText)); /// <summary> /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Commvault.Powershell.Models.HypervisorSettings" /// />. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> internal HypervisorSettings(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; } // actually deserialize ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfo = (Commvault.Powershell.Models.IRegionInfo) content.GetValueForProperty("RegionInfo",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfo, Commvault.Powershell.Models.RegionInfoTypeConverter.ConvertFrom); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZone = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("TimeZone",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZone, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricsMonitoringPolicy = (Commvault.Powershell.Models.IHypervisorMonitoringPolicy) content.GetValueForProperty("MetricsMonitoringPolicy",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricsMonitoringPolicy, Commvault.Powershell.Models.HypervisorMonitoringPolicyTypeConverter.ConvertFrom); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentials = (Commvault.Powershell.Models.IUserNamePassword) content.GetValueForProperty("GuestCredentials",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentials, Commvault.Powershell.Models.UserNamePasswordTypeConverter.ConvertFrom); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentials = (Commvault.Powershell.Models.IUserNamePassword) content.GetValueForProperty("ApplicationCredentials",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentials, Commvault.Powershell.Models.UserNamePasswordTypeConverter.ConvertFrom); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNode = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("MountAccessNode",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNode, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).CustomAttributes = (Commvault.Powershell.Models.IHypervisorCustomAttribute[]) content.GetValueForProperty("CustomAttributes",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).CustomAttributes, __y => TypeConverterExtensions.SelectToArray<Commvault.Powershell.Models.IHypervisorCustomAttribute>(__y, Commvault.Powershell.Models.HypervisorCustomAttributeTypeConverter.ConvertFrom)); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoId = (long?) content.GetValueForProperty("RegionInfoId",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoName = (string) content.GetValueForProperty("RegionInfoName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoName, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoDisplayName = (string) content.GetValueForProperty("RegionInfoDisplayName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoDisplayName, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLatitude = (string) content.GetValueForProperty("RegionInfoLatitude",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLatitude, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLongitude = (string) content.GetValueForProperty("RegionInfoLongitude",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLongitude, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZoneId = (long?) content.GetValueForProperty("TimeZoneId",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZoneId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZoneName = (string) content.GetValueForProperty("TimeZoneName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZoneName, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyId = (long?) content.GetValueForProperty("MetricMonitoringPolicyId",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyName = (string) content.GetValueForProperty("MetricMonitoringPolicyName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyName, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyIsEnabled = (bool?) content.GetValueForProperty("MetricMonitoringPolicyIsEnabled",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyIsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsName = (string) content.GetValueForProperty("GuestCredentialsName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsName, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsPassword = (string) content.GetValueForProperty("GuestCredentialsPassword",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsPassword, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsName = (string) content.GetValueForProperty("ApplicationCredentialsName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsName, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsPassword = (string) content.GetValueForProperty("ApplicationCredentialsPassword",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsPassword, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNodeId = (long?) content.GetValueForProperty("MountAccessNodeId",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNodeId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNodeName = (string) content.GetValueForProperty("MountAccessNodeName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNodeName, global::System.Convert.ToString); AfterDeserializeDictionary(content); } /// <summary> /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into a new instance of <see cref="Commvault.Powershell.Models.HypervisorSettings" /// />. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> internal HypervisorSettings(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; } // actually deserialize ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfo = (Commvault.Powershell.Models.IRegionInfo) content.GetValueForProperty("RegionInfo",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfo, Commvault.Powershell.Models.RegionInfoTypeConverter.ConvertFrom); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZone = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("TimeZone",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZone, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricsMonitoringPolicy = (Commvault.Powershell.Models.IHypervisorMonitoringPolicy) content.GetValueForProperty("MetricsMonitoringPolicy",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricsMonitoringPolicy, Commvault.Powershell.Models.HypervisorMonitoringPolicyTypeConverter.ConvertFrom); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentials = (Commvault.Powershell.Models.IUserNamePassword) content.GetValueForProperty("GuestCredentials",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentials, Commvault.Powershell.Models.UserNamePasswordTypeConverter.ConvertFrom); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentials = (Commvault.Powershell.Models.IUserNamePassword) content.GetValueForProperty("ApplicationCredentials",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentials, Commvault.Powershell.Models.UserNamePasswordTypeConverter.ConvertFrom); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNode = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("MountAccessNode",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNode, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).CustomAttributes = (Commvault.Powershell.Models.IHypervisorCustomAttribute[]) content.GetValueForProperty("CustomAttributes",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).CustomAttributes, __y => TypeConverterExtensions.SelectToArray<Commvault.Powershell.Models.IHypervisorCustomAttribute>(__y, Commvault.Powershell.Models.HypervisorCustomAttributeTypeConverter.ConvertFrom)); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoId = (long?) content.GetValueForProperty("RegionInfoId",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoName = (string) content.GetValueForProperty("RegionInfoName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoName, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoDisplayName = (string) content.GetValueForProperty("RegionInfoDisplayName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoDisplayName, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLatitude = (string) content.GetValueForProperty("RegionInfoLatitude",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLatitude, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLongitude = (string) content.GetValueForProperty("RegionInfoLongitude",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLongitude, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZoneId = (long?) content.GetValueForProperty("TimeZoneId",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZoneId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZoneName = (string) content.GetValueForProperty("TimeZoneName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZoneName, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyId = (long?) content.GetValueForProperty("MetricMonitoringPolicyId",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyName = (string) content.GetValueForProperty("MetricMonitoringPolicyName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyName, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyIsEnabled = (bool?) content.GetValueForProperty("MetricMonitoringPolicyIsEnabled",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyIsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsName = (string) content.GetValueForProperty("GuestCredentialsName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsName, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsPassword = (string) content.GetValueForProperty("GuestCredentialsPassword",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsPassword, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsName = (string) content.GetValueForProperty("ApplicationCredentialsName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsName, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsPassword = (string) content.GetValueForProperty("ApplicationCredentialsPassword",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsPassword, global::System.Convert.ToString); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNodeId = (long?) content.GetValueForProperty("MountAccessNodeId",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNodeId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNodeName = (string) content.GetValueForProperty("MountAccessNodeName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNodeName, global::System.Convert.ToString); AfterDeserializePSObject(content); } /// <summary>Serializes this instance to a json string.</summary> /// <returns>a <see cref="System.String" /> containing this model serialized to JSON text.</returns> public string ToJsonString() => ToJson(null, Commvault.Powershell.Runtime.SerializationMode.IncludeAll)?.ToString(); } /// hypervisorSettings [System.ComponentModel.TypeConverter(typeof(HypervisorSettingsTypeConverter))] public partial interface IHypervisorSettings { } } |