generated/api/Models/HypervisorSettings.PowerShell.cs
// Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/powershell@4.0.708) // 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 <paramref name="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 <paramref name="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> /// <c>OverrideToString</c> will be called if it is implemented. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="stringResult">/// instance serialized to a string, normally it is a Json</param> /// <param name="returnNow">/// set returnNow to true if you provide a customized OverrideToString function</param> partial void OverrideToString(ref string stringResult, 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="HypervisorSettings" /> 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 if (content.Contains("RegionInfo")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfo = (Commvault.Powershell.Models.IRegionInfo) content.GetValueForProperty("RegionInfo",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfo, Commvault.Powershell.Models.RegionInfoTypeConverter.ConvertFrom); } if (content.Contains("TimeZone")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZone = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("TimeZone",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZone, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom); } if (content.Contains("MetricsMonitoringPolicy")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricsMonitoringPolicy = (Commvault.Powershell.Models.IHypervisorMonitoringPolicy) content.GetValueForProperty("MetricsMonitoringPolicy",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricsMonitoringPolicy, Commvault.Powershell.Models.HypervisorMonitoringPolicyTypeConverter.ConvertFrom); } if (content.Contains("GuestCredentials")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentials = (Commvault.Powershell.Models.IUserNamePassword) content.GetValueForProperty("GuestCredentials",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentials, Commvault.Powershell.Models.UserNamePasswordTypeConverter.ConvertFrom); } if (content.Contains("ApplicationCredentials")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentials = (Commvault.Powershell.Models.IUserNamePassword) content.GetValueForProperty("ApplicationCredentials",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentials, Commvault.Powershell.Models.UserNamePasswordTypeConverter.ConvertFrom); } if (content.Contains("MountAccessNode")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNode = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("MountAccessNode",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNode, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom); } if (content.Contains("CustomAttributes")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).CustomAttributes = (System.Collections.Generic.List<Commvault.Powershell.Models.IHypervisorCustomAttribute>) content.GetValueForProperty("CustomAttributes",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).CustomAttributes, __y => TypeConverterExtensions.SelectToList<Commvault.Powershell.Models.IHypervisorCustomAttribute>(__y, Commvault.Powershell.Models.HypervisorCustomAttributeTypeConverter.ConvertFrom)); } if (content.Contains("RegionInfoId")) { ((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))); } if (content.Contains("RegionInfoName")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoName = (string) content.GetValueForProperty("RegionInfoName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoName, global::System.Convert.ToString); } if (content.Contains("RegionInfoDisplayName")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoDisplayName = (string) content.GetValueForProperty("RegionInfoDisplayName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoDisplayName, global::System.Convert.ToString); } if (content.Contains("RegionInfoLatitude")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLatitude = (string) content.GetValueForProperty("RegionInfoLatitude",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLatitude, global::System.Convert.ToString); } if (content.Contains("RegionInfoLongitude")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLongitude = (string) content.GetValueForProperty("RegionInfoLongitude",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLongitude, global::System.Convert.ToString); } if (content.Contains("TimeZoneId")) { ((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))); } if (content.Contains("TimeZoneName")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZoneName = (string) content.GetValueForProperty("TimeZoneName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZoneName, global::System.Convert.ToString); } if (content.Contains("MetricMonitoringPolicyId")) { ((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))); } if (content.Contains("MetricMonitoringPolicyName")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyName = (string) content.GetValueForProperty("MetricMonitoringPolicyName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyName, global::System.Convert.ToString); } if (content.Contains("MetricMonitoringPolicyIsEnabled")) { ((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))); } if (content.Contains("GuestCredentialsName")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsName = (string) content.GetValueForProperty("GuestCredentialsName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsName, global::System.Convert.ToString); } if (content.Contains("GuestCredentialsPassword")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsPassword = (string) content.GetValueForProperty("GuestCredentialsPassword",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsPassword, global::System.Convert.ToString); } if (content.Contains("ApplicationCredentialsName")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsName = (string) content.GetValueForProperty("ApplicationCredentialsName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsName, global::System.Convert.ToString); } if (content.Contains("ApplicationCredentialsPassword")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsPassword = (string) content.GetValueForProperty("ApplicationCredentialsPassword",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsPassword, global::System.Convert.ToString); } if (content.Contains("MountAccessNodeId")) { ((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))); } if (content.Contains("MountAccessNodeName")) { ((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 if (content.Contains("RegionInfo")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfo = (Commvault.Powershell.Models.IRegionInfo) content.GetValueForProperty("RegionInfo",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfo, Commvault.Powershell.Models.RegionInfoTypeConverter.ConvertFrom); } if (content.Contains("TimeZone")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZone = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("TimeZone",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZone, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom); } if (content.Contains("MetricsMonitoringPolicy")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricsMonitoringPolicy = (Commvault.Powershell.Models.IHypervisorMonitoringPolicy) content.GetValueForProperty("MetricsMonitoringPolicy",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricsMonitoringPolicy, Commvault.Powershell.Models.HypervisorMonitoringPolicyTypeConverter.ConvertFrom); } if (content.Contains("GuestCredentials")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentials = (Commvault.Powershell.Models.IUserNamePassword) content.GetValueForProperty("GuestCredentials",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentials, Commvault.Powershell.Models.UserNamePasswordTypeConverter.ConvertFrom); } if (content.Contains("ApplicationCredentials")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentials = (Commvault.Powershell.Models.IUserNamePassword) content.GetValueForProperty("ApplicationCredentials",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentials, Commvault.Powershell.Models.UserNamePasswordTypeConverter.ConvertFrom); } if (content.Contains("MountAccessNode")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNode = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("MountAccessNode",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MountAccessNode, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom); } if (content.Contains("CustomAttributes")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).CustomAttributes = (System.Collections.Generic.List<Commvault.Powershell.Models.IHypervisorCustomAttribute>) content.GetValueForProperty("CustomAttributes",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).CustomAttributes, __y => TypeConverterExtensions.SelectToList<Commvault.Powershell.Models.IHypervisorCustomAttribute>(__y, Commvault.Powershell.Models.HypervisorCustomAttributeTypeConverter.ConvertFrom)); } if (content.Contains("RegionInfoId")) { ((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))); } if (content.Contains("RegionInfoName")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoName = (string) content.GetValueForProperty("RegionInfoName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoName, global::System.Convert.ToString); } if (content.Contains("RegionInfoDisplayName")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoDisplayName = (string) content.GetValueForProperty("RegionInfoDisplayName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoDisplayName, global::System.Convert.ToString); } if (content.Contains("RegionInfoLatitude")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLatitude = (string) content.GetValueForProperty("RegionInfoLatitude",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLatitude, global::System.Convert.ToString); } if (content.Contains("RegionInfoLongitude")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLongitude = (string) content.GetValueForProperty("RegionInfoLongitude",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).RegionInfoLongitude, global::System.Convert.ToString); } if (content.Contains("TimeZoneId")) { ((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))); } if (content.Contains("TimeZoneName")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZoneName = (string) content.GetValueForProperty("TimeZoneName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).TimeZoneName, global::System.Convert.ToString); } if (content.Contains("MetricMonitoringPolicyId")) { ((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))); } if (content.Contains("MetricMonitoringPolicyName")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyName = (string) content.GetValueForProperty("MetricMonitoringPolicyName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).MetricMonitoringPolicyName, global::System.Convert.ToString); } if (content.Contains("MetricMonitoringPolicyIsEnabled")) { ((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))); } if (content.Contains("GuestCredentialsName")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsName = (string) content.GetValueForProperty("GuestCredentialsName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsName, global::System.Convert.ToString); } if (content.Contains("GuestCredentialsPassword")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsPassword = (string) content.GetValueForProperty("GuestCredentialsPassword",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).GuestCredentialsPassword, global::System.Convert.ToString); } if (content.Contains("ApplicationCredentialsName")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsName = (string) content.GetValueForProperty("ApplicationCredentialsName",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsName, global::System.Convert.ToString); } if (content.Contains("ApplicationCredentialsPassword")) { ((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsPassword = (string) content.GetValueForProperty("ApplicationCredentialsPassword",((Commvault.Powershell.Models.IHypervisorSettingsInternal)this).ApplicationCredentialsPassword, global::System.Convert.ToString); } if (content.Contains("MountAccessNodeId")) { ((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))); } if (content.Contains("MountAccessNodeName")) { ((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(); public override string ToString() { var returnNow = false; var result = global::System.String.Empty; OverrideToString(ref result, ref returnNow); if (returnNow) { return result; } return ToJsonString(); } } /// hypervisorSettings [System.ComponentModel.TypeConverter(typeof(HypervisorSettingsTypeConverter))] public partial interface IHypervisorSettings { } } |